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
Copy file name to clipboardExpand all lines: README.md
+17-28Lines changed: 17 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,41 +7,24 @@ The action will create the following resources:
7
7
- An Elastic Beanstalk application, if it doesn't already exist.
8
8
- An Elastic Beanstalk application version, if it doesn't already exist.
9
9
- An Elastic Beanstalk environment, if it doesn't already exist.
10
-
- An Application Load Balancer, if it doesn't already exist, when using the `shared_alb` strategy.
11
10
12
-
Based on the provided inputs, the action will determine which environment is the target environment, i.e., the environment to which a new application version should be deployed.
11
+
Based on the provided inputs, the action will determine which environment is the target environment, to which a new application version should be deployed.
13
12
14
-
## Inputs/Outputs
15
-
16
-
See [action.yml](action.yml)
17
-
18
-
## Deployment Strategies
19
-
20
-
This action supports two blue/green deployment strategies: `swap_cnames` and `shared_alb`.
21
-
22
-
The default strategy is `swap_cnames`.
23
-
24
-
### `swap_cnames`
25
-
26
-
The `swap_cnames` strategy uses the value of the `production_cname` input to determine which environment is the production environment.
27
-
28
-
If neither the blue or green environments exist, it will create a new environment with the `production_cname` input. If the production environment already exists, the action will target the staging environment, creating it if it doesn't exist.
13
+
The action uses the values of the `production_cname` and `staging_cname` inputs to determine which environment is the production or staging environment. Accordingly, the `production_cname` and `staging_cname` inputs should be set to the CNAME prefix of the production and staging environments, respectively.
29
14
30
-
The action will then swap the CNAMEs of the staging and production environments if `promote` is set to true.
15
+
If neither environment exists, it will create a new environment with the `production_cname` input. If the production environment already exists, the action will target the staging environment, creating it if it doesn't exist.
31
16
32
-
### `shared_alb`
17
+
After deploying, the action will swap the CNAMEs of the staging and production environments, if `swap_cnames` is set to true.
33
18
34
-
The `shared_alb` strategy determines which environment is the production environment by finding the `elasticbeanstalk:environment-id` tag on the associated ALB target groups, which is automatically created by Elastic Beanstalk. If the target groups are not properly tagged, the action will fail.
35
-
36
-
If neither the blue or green environments exist, it will provision an Application Load Balancer to share between the environments, and then create the production environment. If the production environment already exists, the action will target the staging environment, creating it if it doesn't exist.
37
-
38
-
When `promote` is set to true, the action will update the default action for each listener on the ALB with a port provided in the `ports` input, so that it forwards to the target group associated with the target environment.
19
+
## Inputs/Outputs
39
20
40
-
When specifying multiple ports, the action will forward to the target group associated with that port, or else the target group associated with the first port provided, if no target group is associated with the port. For example, if `80,443,3000` is provided as the input, and only ports 80 and 3000 have target groups, the action will forward ports 80 and 443 to the target group for port 80, and port 3000 to the target group for port 3000.
21
+
See [action.yml](action.yml)
41
22
42
23
## Terminating Environments
43
24
44
-
If the action finds that the staging environment is in an unhealthy state, it will be terminated and recreated, unless `terminate_unhealthy_environment` is set to false. The environment should be configured to recreate any associated resources that are deleted during environment termination, so that they are available when it is recreated.
25
+
If the action finds that the target environment is in an unhealthy state, it will be terminated and recreated, unless `terminate_unhealthy_environment` is set to false. The environment should be configured to recreate any associated resources that are deleted during environment termination, so that they are available when it is recreated.
26
+
27
+
The action will also enable or disable termination protection on the target environment's underlying CloudFormation stack, if `enable_termination_protection` or `disable_termination_protection` are set to true, respectively.
When using a [shared load balancer](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb-shared.html), the `update_listener_rules` input can be set to true, so that the action will update any listener rules that are tagged with a `bluegreenbeanstalk:target_cname` key, whose value is equal to the `production_cname` or `staging_cname` inputs, so that the listener rule points to the same target group as the CNAME.
72
+
73
+
To forward to a process on a port besides the default port 80, set another tag on the listener rule with a `bluegreenbeanstalk:target_port` key and a value equal to the port number.
Copy file name to clipboardExpand all lines: action.yml
+23-21Lines changed: 23 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,11 @@ inputs:
15
15
blue_env:
16
16
description: "Name of the blue environment."
17
17
required: true
18
+
create_environment:
19
+
description: "Whether to create a new environment during deployment if the target environment doesn't exist."
20
+
default: "true"
18
21
deploy:
19
-
description: "Whether to deploy the new application version to the target environment."
22
+
description: "Whether to deploy to the target environment."
20
23
default: "false"
21
24
disable_termination_protection:
22
25
description: "Whether to disable termination protection for the target environment's CloudFormation stack before attempting to terminate it."
@@ -28,31 +31,33 @@ inputs:
28
31
description: "Name of the green environment."
29
32
required: true
30
33
option_settings:
31
-
description: "Path to a JSON file of option settings to use when creating a new environment. When using custom option settings, the default option settings will be ignored, but the SharedLoadBalancer will still be provided when using the `shared_alb` strategy."
34
+
description: "Path to a JSON file consisting of an array of option settings to use when creating a new environment."
32
35
platform_branch_name:
33
36
description: "Name of the platform branch to use. When creating a new environment, it will be launched with the latest version of the specified platform branch. To see the list of available platform branches, run the `aws elasticbeanstalk list-platform-branches` command."
34
-
prep:
35
-
description: "When prep is set to true, the action will exit if the target environment is healthy, or create a new environment if it is not healthy. This is useful for preparing the target environment, e.g. with the sample application, before deploying a new application version in a later step."
36
-
default: "false"
37
-
ports:
38
-
description: "Comma-separated list of ALB listener ports for use with the `shared_alb` strategy. When using the action to create an ALB, HTTP listeners will be created for each port. To enable HTTPS, port 443 must be configured on the ALB with ACM. When using an existing ALB, the action will update each specified port's default listener rule to point to the target environment if `promote` is set to true."
39
-
default: "80"
40
37
production_cname:
41
-
description: "CNAME prefix for the domain that serves production traffic. Only required for the `swap_cnames` strategy."
42
-
promote:
43
-
description: "Whether to promote the target environment to production. When using the `swap_cnames` strategy, the action will swap the CNAMEs of the blue and green environments to redirect production traffic to the target environment. When using the `shared_alb` strategy, the action will update the shared Application Load Balancer's default listener rule to point to the target environment, replacing the other environment."
44
-
default: "false"
45
-
staging_cname:
46
-
description: "CNAME prefix for the staging environment when using the `swap_cnames` strategy."
38
+
description: "CNAME prefix for the domain that serves production traffic."
39
+
required: true
47
40
source_bundle:
48
41
description: "Path to the source bundle to deploy. If not specified, the sample application will be used."
49
-
strategy:
50
-
description: "Deployment strategy to use: `swap_cnames` or `shared_alb`. See the `promote` input description for more details."
51
-
default: "swap_cnames"
42
+
staging_cname:
43
+
description: "CNAME prefix for the staging environment."
44
+
required: true
45
+
swap_cnames:
46
+
description: "Whether to swap the CNAMEs of the blue and green environments."
47
+
default: "false"
52
48
template_name:
53
49
description: "Name of an Elastic Beanstalk configuration template to use when creating a new environment."
54
50
terminate_unhealthy_environment:
55
-
description: "Whether to terminate an unhealthy target environment. If set to false, the action will exit with an error when the target environment is unhealthy."
51
+
description: "Whether to terminate an unhealthy target environment."
52
+
default: "true"
53
+
update_environment:
54
+
description: "Whether to update an existing environment during deployment."
55
+
default: "true"
56
+
update_listener_rules:
57
+
description: "When set to true, the action will update any elbv2 listener rules on the environments' SharedLoadBalancer tagged with a `bluegreenbeanstalk:target_cname` key, whose value is equal to the staging or production CNAME prefix, so that it forwards to the corresponding target group. The action will also remove any target group from the listener before terminating the environment. The port of the process may be specified by another tag with the key `bluegreenbeanstalk:target_port` whose value is the port number. If no such tag is found, the default port of 80 will be used."
58
+
default: "false"
59
+
use_default_option_settings:
60
+
description: "Whether to use default option settings when creating a new environment."
56
61
default: "true"
57
62
version_description:
58
63
description: "Description to use for the new application version."
@@ -67,9 +72,6 @@ inputs:
67
72
wait_for_termination:
68
73
description: "Whether to wait for an environment to be terminated."
69
74
default: "true"
70
-
use_default_option_settings:
71
-
description: "Whether to use default option settings when creating a new environment."
0 commit comments