diff --git a/Dockerfile b/Dockerfile index 404607f..1d746ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM cloudposse/helmfiles:0.8.6 as helmfiles - -FROM cloudposse/geodesic:0.123.0 +FROM cloudposse/geodesic:0.123.1 ENV DOCKER_IMAGE="cloudposse/testing.cloudposse.co" ENV DOCKER_TAG="latest" @@ -44,11 +42,7 @@ RUN apk add terraform_0.12@cloudposse terraform@cloudposse==0.12.10-r0 RUN apk add helm@cloudposse==2.14.3-r0 # Pin helmfile to 0.81.0 for stability -RUN apk update && apk add helmfile@cloudposse==0.82.0-r0 - -# Copy helmfiles -COPY --from=helmfiles /helmfile.d/ /conf/helmfile.d/ -COPY --from=helmfiles /scripts/ /conf/scripts/ +RUN apk update && apk add helmfile@cloudposse==0.94.1-r0 # Place configuration in 'conf/' directory COPY conf/ /conf/ diff --git a/atlantis.yaml b/atlantis.yaml index 03ef817..5fdd457 100644 --- a/atlantis.yaml +++ b/atlantis.yaml @@ -137,6 +137,21 @@ projects: apply_requirements: - "approved" + - name: "dynamodb" + workflow: "make" + dir: "conf/dynamodb" + workspace: "default" + terraform_version: "v0.12.10" + autoplan: + when_modified: + - "Makefile*" + - "*.tf" + - "*.tfvars" + - ".envrc" + enabled: true + apply_requirements: + - "approved" + workflows: make: plan: diff --git a/conf/dynamodb/.envrc b/conf/dynamodb/.envrc new file mode 100644 index 0000000..e07109b --- /dev/null +++ b/conf/dynamodb/.envrc @@ -0,0 +1,5 @@ +source_up +use envrc +use terraform 0.12 +use atlantis +use tfenv diff --git a/conf/dynamodb/Makefile.tasks b/conf/dynamodb/Makefile.tasks new file mode 100644 index 0000000..5c1b19d --- /dev/null +++ b/conf/dynamodb/Makefile.tasks @@ -0,0 +1,9 @@ +-include ${TF_MODULE_CACHE}/Makefile + +deps: + mkdir -p ${TF_MODULE_CACHE} + terraform init + +## Reset this project +reset: + rm -rf ${TF_MODULE_CACHE} .terraform diff --git a/conf/dynamodb/terraform.envrc b/conf/dynamodb/terraform.envrc new file mode 100644 index 0000000..0a787e4 --- /dev/null +++ b/conf/dynamodb/terraform.envrc @@ -0,0 +1,6 @@ +export TF_MODULE_CACHE=.module + +# Import the remote module +export TF_CLI_INIT_FROM_MODULE="git::https://github.com/cloudposse/terraform-root-modules.git//aws/dynamodb?ref=tags/0.115.0" + +export TF_CLI_PLAN_PARALLELISM=2 diff --git a/conf/dynamodb/terraform.tfvars b/conf/dynamodb/terraform.tfvars new file mode 100644 index 0000000..04c01e2 --- /dev/null +++ b/conf/dynamodb/terraform.tfvars @@ -0,0 +1,87 @@ +name = "trader-page-stats" + +billing_mode = "PAY_PER_REQUEST" + +hash_key = "trader_id" + +hash_key_type = "N" + +range_key = "ds" + +range_key_type = "S" + +ttl_attribute = "" + +dynamodb_attributes = [] + +# Specify additional attributes only if they are part of local or global secondary indexes +# Otherwise, the error "All attributes must be indexed. Unused attributes: ..." will be thrown +# See https://stackoverflow.com/questions/50006885/terraform-dynamodb-all-attributes-must-be-indexed +#dynamodb_attributes = [ +# { +# name = "lookup_count" +# type = "N" +# }, +# { +# name = "search_count" +# type = "N" +# }, +# { +# name = "external_count" +# type = "N" +# }, +# { +# name = "total_count" +# type = "N" +# }, +# { +# name = "site" +# type = "N" +# } +#] + +global_secondary_index_map = [] + +local_secondary_index_map = [] + +chamber_parameters_enabled = false + +dynamodb_chamber_service = "dynamodb" + +enable_streams = false + +stream_view_type = "" + +enable_encryption = true + +enable_point_in_time_recovery = true + +enable_backup = true + +backup_kms_key_arn = "" + +backup_schedule = "cron(0 12 * * ? *)" + +backup_start_window = 60 + +backup_completion_window = 120 + +backup_cold_storage_after = 180 + +backup_delete_after = 360 + +# If billing_mode = "PAY_PER_REQUEST", autoscaling is not supported (setting `enable_autoscaler` to `true` has no effect). +# In billing_mode = "PAY_PER_REQUEST", AWS scales the table automatically +enable_autoscaler = false + +autoscale_write_target = 50 + +autoscale_read_target = 50 + +autoscale_min_read_capacity = 5 + +autoscale_max_read_capacity = 20 + +autoscale_min_write_capacity = 5 + +autoscale_max_write_capacity = 20