Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Lambda buckets & ECS tags #4

Closed

Conversation

segfault
Copy link
Contributor

@segfault segfault commented Aug 5, 2020

To support using tfvars as an environment state snapshot in our deploy tooling we need to have the terraform honor specific settings. This changes the default lambda behavior which uploads stubs over to one that supports the original workflow and one where the deployable is explicitly specified. The same behavior and intent exists on the ECS side.

This is one possible deployment workflow, but it should work for any existing environments with zero friction.

This is intended to support using the terraform as a primary deployment tool for the application into different environments.
By default stub code is pushed into s3 but if the `tfvars` are specified then the lambdas will honor that revised code ultimately allowing us to version the `tfvars` file as part of our deployments.
The goal is to provide a reproducible snapshot of any environment using the `tfvars` file.
This allows the tfvars to become an environment's source of truth.
@jasnell
Copy link
Contributor

jasnell commented Aug 5, 2020

/cc @dgonzalez

@stevenbower stevenbower force-pushed the feature-lambda-buckets branch from 7f38f1a to 2b1abf8 Compare August 10, 2020 14:24
callback_lambda_s3_bucket = ""
callback_lambda_s3_key = ""
cso_lambda_s3_bucket = ""
cso_lambda_s3_key = ""
Copy link
Contributor

@dgonzalez dgonzalez Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed on a call about naming:

lambda_cso_s3_key

@dgonzalez
Copy link
Contributor

Pending small cosmetic change but pretty good!

ecs_api.tf Outdated
@@ -93,9 +93,10 @@ data "template_file" "api_service_container_definitions" {
template = file("templates/api_service_task_definition.tpl")

vars = {
api_image_uri = "${aws_ecr_repository.api.repository_url}:latest"
api_image_uri = "${aws_ecr_repository.api.repository_url}:${var.api_container_tag}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@segfault Guessing this is a redundant line ?

Can we change the container in the var names to image ?

Is the idea that you could set the migrations_image_repo_url ? If so will the created ECR repos be ignored if you use a different image registry ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@@ -0,0 +1,18 @@
resource "aws_s3_bucket" "lambdas" {
bucket = module.labels.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this name - should we have a suffix

@segfault
Copy link
Contributor Author

redoing this against the current repo based on the feedback

dgonzalez pushed a commit that referenced this pull request Aug 28, 2020
@segfault segfault deleted the feature-lambda-buckets branch October 5, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants