Skip to content

Commit

Permalink
Add environment variables for dynamic object storage
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Dec 27, 2024
1 parent 25e9468 commit 4688b6d
Show file tree
Hide file tree
Showing 23 changed files with 169 additions and 57 deletions.
4 changes: 3 additions & 1 deletion storage/aws/elasticache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Amazon ElastiCache is a fully managed, Redis- and Memcached-compatible service d

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.82.2 |

## Modules

Expand All @@ -36,6 +36,8 @@ Amazon ElastiCache is a fully managed, Redis- and Memcached-compatible service d

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adapter_absolute_path"></a> [adapter\_absolute\_path](#input\_adapter\_absolute\_path) | The adapter's absolute path | `string` | `"/adapters/object/redis/ArmoniK.Core.Adapters.Redis.dll"` | no |
| <a name="input_adapter_class_name"></a> [adapter\_class\_name](#input\_adapter\_class\_name) | Name of the adapter's class | `string` | `"ArmoniK.Core.Adapters.Redis.ObjectBuilder"` | no |
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any modifications are applied immediately, or during the next maintenance window | `bool` | `false` | no |
| <a name="input_automatic_failover_enabled"></a> [automatic\_failover\_enabled](#input\_automatic\_failover\_enabled) | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails | `bool` | `false` | no |
| <a name="input_client_name"></a> [client\_name](#input\_client\_name) | Name of the redis client | `string` | `"ArmoniK.Core"` | no |
Expand Down
14 changes: 8 additions & 6 deletions storage/aws/elasticache/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ output "kms_key_id" {
output "env" {
description = "Elements to be set as environment variables"
value = ({
"Components__ObjectStorage" = var.object_storage_adapter
"Redis__EndpointUrl" = "${aws_elasticache_replication_group.elasticache.primary_endpoint_address}:${aws_elasticache_replication_group.elasticache.port}"
"Redis__Ssl" = var.ssl_option
"Redis__ClientName" = var.client_name
"Redis__CaPath" = ""
"Redis__InstanceName" = var.instance_name
"Components__ObjectStorage" = var.object_storage_adapter
"Components__QueueAdaptorSettings__ClassName" = var.adapter_class_name
"Components__QueueAdaptorSettings__AdapterAbsolutePath" = var.adapter_absolute_path
"Redis__EndpointUrl" = "${aws_elasticache_replication_group.elasticache.primary_endpoint_address}:${aws_elasticache_replication_group.elasticache.port}"
"Redis__Ssl" = var.ssl_option
"Redis__ClientName" = var.client_name
"Redis__CaPath" = ""
"Redis__InstanceName" = var.instance_name
})
}
12 changes: 12 additions & 0 deletions storage/aws/elasticache/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,15 @@ variable "ssl_option" {
type = string
default = "true"
}

variable "adapter_class_name" {
description = "Name of the adapter's class"
type = string
default = "ArmoniK.Core.Adapters.Redis.ObjectBuilder"
}

variable "adapter_absolute_path" {
description = "The adapter's absolute path"
type = string
default = "/adapters/object/redis/ArmoniK.Core.Adapters.Redis.dll"
}
8 changes: 4 additions & 4 deletions storage/aws/mq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ t

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.7.1 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.5.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.82.2 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.35.1 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.6.3 |

## Modules

Expand All @@ -41,7 +41,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adapter_absolute_path"></a> [adapter\_absolute\_path](#input\_adapter\_absolute\_path) | The adapter's absolut path | `string` | `"/adapters/queue/amqp/ArmoniK.Core.Adapters.Amqp.dll"` | no |
| <a name="input_adapter_absolute_path"></a> [adapter\_absolute\_path](#input\_adapter\_absolute\_path) | The adapter's absolute path | `string` | `"/adapters/queue/amqp/ArmoniK.Core.Adapters.Amqp.dll"` | no |
| <a name="input_adapter_class_name"></a> [adapter\_class\_name](#input\_adapter\_class\_name) | Name of the adapter's class | `string` | `"ArmoniK.Core.Adapters.Amqp.QueueBuilder"` | no |
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any broker modifications are applied immediately, or during the next maintenance window | `bool` | `false` | no |
| <a name="input_authentication_strategy"></a> [authentication\_strategy](#input\_authentication\_strategy) | AWS MQ authentication strategy | `string` | `"simple"` | no |
Expand Down
2 changes: 1 addition & 1 deletion storage/aws/mq/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ variable "adapter_class_name" {
}

variable "adapter_absolute_path" {
description = "The adapter's absolut path"
description = "The adapter's absolute path"
type = string
default = "/adapters/queue/amqp/ArmoniK.Core.Adapters.Amqp.dll"
}
Expand Down
4 changes: 3 additions & 1 deletion storage/aws/s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This module creates an AWS S3 bucket with these constraints:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.82.2 |

## Modules

Expand All @@ -44,6 +44,8 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adapter_absolute_path"></a> [adapter\_absolute\_path](#input\_adapter\_absolute\_path) | The adapter's absolute path | `string` | `"/adapters/object/s3/ArmoniK.Core.Adapters.S3.dll"` | no |
| <a name="input_adapter_class_name"></a> [adapter\_class\_name](#input\_adapter\_class\_name) | Name of the adapter's class | `string` | `"ArmoniK.Core.Adapters.S3.ObjectBuilder"` | no |
| <a name="input_attach_deny_insecure_transport_policy"></a> [attach\_deny\_insecure\_transport\_policy](#input\_attach\_deny\_insecure\_transport\_policy) | Controls if S3 bucket should have deny non-SSL transport policy attached | `bool` | `true` | no |
| <a name="input_attach_policy"></a> [attach\_policy](#input\_attach\_policy) | Controls if S3 bucket should have bucket policy attached (set to `true` to use value of `policy` as bucket policy) | `bool` | `false` | no |
| <a name="input_attach_public_policy"></a> [attach\_public\_policy](#input\_attach\_public\_policy) | Controls if a user defined public bucket policy will be attached (set to `false` to allow upstream to apply defaults to the bucket) | `bool` | `false` | no |
Expand Down
14 changes: 8 additions & 6 deletions storage/aws/s3/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ output "arn" {
output "env" {
description = "Elements to be set as environment variables"
value = ({
"Components__ObjectStorage" = var.object_storage_adapter
"S3__BucketName" = aws_s3_bucket.s3_bucket.bucket
"S3__UseChecksum" = true
"S3__MustForcePathStyle" = true
"S3__UseChunkEncoding" = true
"S3__EndpointUrl" = "https://s3.${aws_s3_bucket.s3_bucket.region}.amazonaws.com"
"Components__ObjectStorage" = var.object_storage_adapter
"Components__QueueAdaptorSettings__ClassName" = var.adapter_class_name
"Components__QueueAdaptorSettings__AdapterAbsolutePath" = var.adapter_absolute_path
"S3__BucketName" = aws_s3_bucket.s3_bucket.bucket
"S3__UseChecksum" = true
"S3__MustForcePathStyle" = true
"S3__UseChunkEncoding" = true
"S3__EndpointUrl" = "https://s3.${aws_s3_bucket.s3_bucket.region}.amazonaws.com"
})
}
12 changes: 12 additions & 0 deletions storage/aws/s3/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,15 @@ variable "object_storage_adapter" {
type = string
default = "ArmoniK.Adapters.S3.ObjectStorage"
}

variable "adapter_class_name" {
description = "Name of the adapter's class"
type = string
default = "ArmoniK.Core.Adapters.S3.ObjectBuilder"
}

variable "adapter_absolute_path" {
description = "The adapter's absolute path"
type = string
default = "/adapters/object/s3/ArmoniK.Core.Adapters.S3.dll"
}
16 changes: 9 additions & 7 deletions storage/gcp/gcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ This module creates a Google Cloud Storage with these possibilities :

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | >= 4.75.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.7.1 |
| <a name="provider_google"></a> [google](#provider\_google) | 6.14.1 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | 2.35.1 |

## Modules

Expand All @@ -48,34 +48,36 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adapter_absolute_path"></a> [adapter\_absolute\_path](#input\_adapter\_absolute\_path) | The adapter's absolute path | `string` | `"/adapters/object/s3/ArmoniK.Core.Adapters.S3.dll"` | no |
| <a name="input_adapter_class_name"></a> [adapter\_class\_name](#input\_adapter\_class\_name) | Name of the adapter's class | `string` | `"ArmoniK.Core.Adapters.S3.ObjectBuilder"` | no |
| <a name="input_autoclass"></a> [autoclass](#input\_autoclass) | The bucket's Autoclass configuration. | `bool` | `null` | no |
| <a name="input_cors"></a> [cors](#input\_cors) | The bucket's Cross-Origin Resource Sharing (CORS) configuration. | <pre>object({<br> origin = list(string)<br> method = list(string)<br> response_header = list(string)<br> max_age_seconds = number<br> })</pre> | `null` | no |
| <a name="input_cors"></a> [cors](#input\_cors) | The bucket's Cross-Origin Resource Sharing (CORS) configuration. | <pre>object({<br/> origin = list(string)<br/> method = list(string)<br/> response_header = list(string)<br/> max_age_seconds = number<br/> })</pre> | `null` | no |
| <a name="input_data_locations"></a> [data\_locations](#input\_data\_locations) | The bucket's custom location configuration, which specifies the individual regions that comprise a dual-region bucket. If the bucket is designated a single or multi-region, the parameters are empty. | `list(string)` | `null` | no |
| <a name="input_default_acl"></a> [default\_acl](#input\_default\_acl) | Configure this ACL to be the default ACL. | `string` | `null` | no |
| <a name="input_default_event_based_hold"></a> [default\_event\_based\_hold](#input\_default\_event\_based\_hold) | Whether or not to automatically apply an eventBasedHold to new objects added to the bucket. | `bool` | `null` | no |
| <a name="input_default_kms_key_name"></a> [default\_kms\_key\_name](#input\_default\_kms\_key\_name) | The id of a Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. | `string` | `null` | no |
| <a name="input_entity_bucket_access_control"></a> [entity\_bucket\_access\_control](#input\_entity\_bucket\_access\_control) | The entity holding the permission. | `string` | `null` | no |
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | When deleting a bucket, this boolean option will delete all contained objects. | `bool` | `false` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | A map of key/value label pairs to assign to the bucket. | `map(string)` | `{}` | no |
| <a name="input_lifecycle_rule"></a> [lifecycle\_rule](#input\_lifecycle\_rule) | The bucket's lifecycle rules configuration. | <pre>map(object({<br> action = object({<br> type = string<br> storage_class = string<br> })<br> condition = object({<br> age = number<br> created_before = string<br> with_state = string<br> matches_storage_class = list(string)<br> matches_prefix = list(string)<br> matches_suffix = list(string)<br> num_newer_versions = number<br> custom_time_before = string<br> days_since_custom_time = string<br> days_since_noncurrent_time = string<br> noncurrent_time_before = string<br> })<br> }))</pre> | `null` | no |
| <a name="input_lifecycle_rule"></a> [lifecycle\_rule](#input\_lifecycle\_rule) | The bucket's lifecycle rules configuration. | <pre>map(object({<br/> action = object({<br/> type = string<br/> storage_class = string<br/> })<br/> condition = object({<br/> age = number<br/> created_before = string<br/> with_state = string<br/> matches_storage_class = list(string)<br/> matches_prefix = list(string)<br/> matches_suffix = list(string)<br/> num_newer_versions = number<br/> custom_time_before = string<br/> days_since_custom_time = string<br/> days_since_noncurrent_time = string<br/> noncurrent_time_before = string<br/> })<br/> }))</pre> | `null` | no |
| <a name="input_location"></a> [location](#input\_location) | Location for the bucket: regional, dual-regional or multi-regional [GCS locations](https://cloud.google.com/storage/docs/locations). | `string` | n/a | yes |
| <a name="input_logging"></a> [logging](#input\_logging) | The bucket's Access & Storage Logs configuration. | <pre>object({<br> log_bucket = string<br> log_object_prefix = string<br> })</pre> | `null` | no |
| <a name="input_logging"></a> [logging](#input\_logging) | The bucket's Access & Storage Logs configuration. | <pre>object({<br/> log_bucket = string<br/> log_object_prefix = string<br/> })</pre> | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the bucket. | `string` | n/a | yes |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace of ArmoniK storage resources | `string` | `"armonik"` | no |
| <a name="input_object_storage_adapter"></a> [object\_storage\_adapter](#input\_object\_storage\_adapter) | Name of the ArmoniK adapter to use for the storage | `string` | `"ArmoniK.Adapters.S3.ObjectStorage"` | no |
| <a name="input_password"></a> [password](#input\_password) | Google Cloud storage secret to use as passeword | `string` | `""` | no |
| <a name="input_predefined_acl"></a> [predefined\_acl](#input\_predefined\_acl) | The canned GCS ACL to apply. | `string` | `null` | no |
| <a name="input_public_access_prevention"></a> [public\_access\_prevention](#input\_public\_access\_prevention) | Prevents public access to a bucket. Acceptable values are 'inherited' or 'enforced' | `string` | `null` | no |
| <a name="input_requester_pays"></a> [requester\_pays](#input\_requester\_pays) | Enables Requester Pays on a storage bucket. | `bool` | `null` | no |
| <a name="input_retention_policy"></a> [retention\_policy](#input\_retention\_policy) | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br> is_locked = bool<br> retention_period = number<br> })</pre> | `null` | no |
| <a name="input_retention_policy"></a> [retention\_policy](#input\_retention\_policy) | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br/> is_locked = bool<br/> retention_period = number<br/> })</pre> | `null` | no |
| <a name="input_role_bucket_access_control"></a> [role\_bucket\_access\_control](#input\_role\_bucket\_access\_control) | The access permission for the entity. | `string` | `null` | no |
| <a name="input_role_entity_acl"></a> [role\_entity\_acl](#input\_role\_entity\_acl) | List of role/entity pairs in the form "ROLE:entity". | `list(string)` | `null` | no |
| <a name="input_roles"></a> [roles](#input\_roles) | Roles to bind to the bucket | `map(set(string))` | `null` | no |
| <a name="input_storage_class"></a> [storage\_class](#input\_storage\_class) | The Storage Class of the new bucket. | `string` | `"STANDARD"` | no |
| <a name="input_uniform_bucket_level_access"></a> [uniform\_bucket\_level\_access](#input\_uniform\_bucket\_level\_access) | Enables Uniform bucket-level access access to a bucket | `bool` | `null` | no |
| <a name="input_username"></a> [username](#input\_username) | Google Cloud storage access id to use as username | `string` | `""` | no |
| <a name="input_versioning"></a> [versioning](#input\_versioning) | The bucket's Versioning configuration. | `bool` | `null` | no |
| <a name="input_website"></a> [website](#input\_website) | Configuration if the bucket acts as a website. Structure is documented below. | <pre>object({<br> main_page_suffix = string<br> not_found_page = string<br> })</pre> | `null` | no |
| <a name="input_website"></a> [website](#input\_website) | Configuration if the bucket acts as a website. Structure is documented below. | <pre>object({<br/> main_page_suffix = string<br/> not_found_page = string<br/> })</pre> | `null` | no |

## Outputs

Expand Down
14 changes: 8 additions & 6 deletions storage/gcp/gcs/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ output "iam_members" {
output "env" {
description = "Elements to be set as environment variables"
value = ({
"Components__ObjectStorage" = var.object_storage_adapter
"S3__BucketName" = google_storage_bucket.gcs.name
"S3__UseChecksum" = false
"S3__MustForcePathStyle" = false
"S3__UseChunkEncoding" = false
"S3__EndpointUrl" = "https://storage.googleapis.com"
"Components__ObjectStorage" = var.object_storage_adapter
"Components__QueueAdaptorSettings__ClassName" = var.adapter_class_name
"Components__QueueAdaptorSettings__AdapterAbsolutePath" = var.adapter_absolute_path
"S3__BucketName" = google_storage_bucket.gcs.name
"S3__UseChecksum" = false
"S3__MustForcePathStyle" = false
"S3__UseChunkEncoding" = false
"S3__EndpointUrl" = "https://storage.googleapis.com"
})
}

Expand Down
12 changes: 12 additions & 0 deletions storage/gcp/gcs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,15 @@ variable "password" {
type = string
default = ""
}

variable "adapter_class_name" {
description = "Name of the adapter's class"
type = string
default = "ArmoniK.Core.Adapters.S3.ObjectBuilder"
}

variable "adapter_absolute_path" {
description = "The adapter's absolute path"
type = string
default = "/adapters/object/s3/ArmoniK.Core.Adapters.S3.dll"
}
Loading

0 comments on commit 4688b6d

Please sign in to comment.