Created
August 2, 2019 19:42
-
-
Save hsyyid/24d27024b89ca5bf5a6a39c747dfdf4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Lambda + API Gateway | |
resource "local_file" "chalice_config" { | |
# Output vars to chalice config | |
filename = ".chalice/config.json" | |
content = "${format(file(".chalice/base-config.json"), var.user_pool_name, var.user_pool_arn)}" | |
# Deploy via chalice | |
provisioner "local-exec" { | |
command = "rm -r .chalice/deployed && chalice deploy" | |
environment = { | |
AWS_ACCESS_KEY_ID = "${var.access_key}" | |
AWS_SECRET_ACCESS_KEY = "${var.secret_key}" | |
AWS_DEFAULT_REGION = "${var.region}" | |
} | |
} | |
provisioner "local-exec" { | |
when = "destroy" | |
command = "chalice delete" | |
environment = { | |
AWS_ACCESS_KEY_ID = "${var.access_key}" | |
AWS_SECRET_ACCESS_KEY = "${var.secret_key}" | |
AWS_DEFAULT_REGION = "${var.region}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment