You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| codedeploy_service_role_arn | string | ARN of the IAM Role for the CodeDeploy to use to initiate new deployments. (usually the PowerBuilder Role) |
72
+
| lambda_src_dir | string | Directory that contains your lambda source code |
73
+
| handler | string | Lambda event handler |
74
+
| runtime | string | Lambda runtime |
75
+
| environment_variables | map(string) | A map that defines environment variables for the Lambda function. |
76
+
| hosted_zone |[object](#hosted_zone)| Hosted Zone object to redirect to ALB. (Can pass in the aws_hosted_zone object). A and AAAA records created in this hosted zone. |
77
+
| https_certificate_arn | string | ARN of the HTTPS certificate of the hosted zone/domain. |
78
+
| codedeploy_lifecycle_hooks | [object](#codedeploy_lifecycle_hooks) | Define Lambda Functions for CodeDeploy lifecycle event hooks. Or set this variable to null to not have any lifecycle hooks invoked. Defaults to null | null
79
+
| codedeploy_test_listener_port | number | The port for a codedeploy test listener. If provided CodeDeploy will use this port for test traffic on the new replacement set during the blue-green deployment process before shifting production traffic to the replacement set. Defaults to null | null
80
+
| vpc_id | string | VPC ID to deploy ECS fargate service. |
81
+
| public_subnet_ids | list(string) | List of subnet IDs for the ALB. |
82
+
| private_subnet_ids | list(string) | List of subnet IDs for the Lambda service. |
83
+
| tags | map(string) | A map of AWS Tags to attach to each resource created | {}
84
+
| role_permissions_boundary_arn | string | IAM Role Permissions Boundary ARN |
85
+
| log_retention_in_days | number | CloudWatch log group retention in days. Defaults to 7. | 7
86
+
| lambda_policies | list(string) | List of IAM Policy ARNs to attach to the lambda role. | []
87
+
| security_groups | list(string) | List of extra security group IDs to attach to the lambda. | []
88
+
89
+
#### codedeploy_lifecycle_hooks
90
+
91
+
This variable is used when generating the [appspec.json](#appspec) file. This will define what Lambda Functions to invoke
92
+
at specific [lifecycle hooks](https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html).
93
+
Set this variable to `null` if you don't want to invoke any lambda functions. Set each hook to `null` if you don't need
94
+
a specific lifecycle hook function.
95
+
96
+
***`before_allow_traffic`** - lambda function name to run before public traffic points to new lambda version
97
+
***`after_allow_traffic`** - lambda function name to run after public traffic points to new lambda version
98
+
99
+
#### hosted_zone
100
+
101
+
You can pass in either the object from the AWS terraform provider for an AWS Hosted Zone, or just an object with the following attributes:
102
+
***`name`** - (Required) Name of the hosted zone
103
+
***`id`** - (Required) ID of the hosted zone
104
+
105
+
#### CloudWatch logs
106
+
107
+
This module will create a CloudWatch log group named `/aws/lambda/<app_name>-<env>`.
108
+
109
+
For instance with the [above example](#usage) the logs could be found in the CloudWatch log group: `aws/lambda/my-lambda-dev`.
33
110
34
111
## Outputs
112
+
##### TODO fill out this section
113
+
35
114
| Name | Type | Description |
36
115
| --- | --- | --- |
116
+
117
+
#### appspec
118
+
##### TODO fix this section (copy pasta from standard fargate)
119
+
120
+
This module also creates a JSON file in the project directory: `appspec.json` used to initiate a CodeDeploy Deployment.
##### TODO fix this section (copy pasta from standard fargate)
182
+
183
+
This module creates a blue-green deployment process with CodeDeploy. If a `codedeploy_test_listener_port` is provided
184
+
this module will create an ALB listener that will allow public traffic from that port to the running lambda.
185
+
186
+
When a CodeDeploy deployment is initiated (either via a pipeline or manually) CodeDeploy will:
187
+
1. call lambda function defined for `BeforeInstall` hook
188
+
2. attempt to create a new set of tasks (called the replacement set) with the new task definition etc. in the unused ALB Target Group
189
+
3. call lambda function defined for `AfterInstall` hook
190
+
4. associate the test listener (if defined) to the new target group
191
+
5. call lambda function defined for `AfterAllowTestTraffic` hook
192
+
6. call lambda function defined for `BeforeAllowTraffic` hook
193
+
7. associate the production listener to the new target group
194
+
8. call lambda function defined for `AfterAllowTraffic` hook
195
+
9. wait for the `codedeploy_termination_wait_time` in minutes before destroying the original task set (this is useful if you need to manually rollback)
196
+
197
+
At any step (except step #1) the deployment can rollback (either manually or by the lambda functions in the lifecycle hooks or if there was an error trying to actually deploy)
198
+
199
+
##### TODO add diagrams to explain the blue-green deployment process
200
+
201
+
## Note
202
+
203
+
If you require additional variables please create an [issue](https://github.com/byu-oit/terraform-aws-lambda-api/issues)
204
+
and/or a [pull request](https://github.com/byu-oit/terraform-aws-lambda-api/pulls) to add the variable and reach
205
+
out to the Terraform Working Group on slack (`#terraform` channel).
0 commit comments