Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
aws-code-deploy: circleci/aws-code-deploy@3.0.0
Use aws-code-deploy
elements in your existing workflows and jobs.
Deploy an application to AWS CodeDeploy using static AWS keys for authentication. Import the aws-cli orb and authenticate using the aws-cli/setup command with static AWS keys stored as env_vars (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
version: '2.1'
orbs:
aws-cli: circleci/aws-cli@3.1
aws-code-deploy: circleci/aws-code-deploy@3.0
workflows:
deploy_application:
jobs:
- aws-code-deploy/deploy:
application-name: myApplication
auth:
- aws-cli/setup
bundle-bucket: myApplicationS3Bucket
bundle-key: myS3BucketKey
deployment-group: myDeploymentGroup
service-role-arn: myDeploymentGroupRoleARN
Deploy an application to AWS CodeDeploy using OIDC authentication. Import the aws-cli orb and authenticate using the aws-cli/setup command with a valid role-arn for OIDC authentication.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
version: '2.1'
orbs:
aws-cli: circleci/aws-cli@3.1
aws-code-deploy: circleci/aws-code-deploy@3.0
workflows:
deploy_application:
jobs:
- aws-code-deploy/deploy:
application-name: myApplication
auth:
- aws-cli/setup:
profile: OIDC-USER
role-arn: arn:aws:iam::123456789012:role/VALID_OIDC_CODEDEPLOY_ROLE
bundle-bucket: myApplicationS3Bucket
bundle-key: myS3BucketKey
context: CircleCI_OIDC_Token
deployment-group: myDeploymentGroup
profile: OIDC-USER
service-role-arn: myDeploymentGroupRoleARN
Ensures an application and deployment group exist then proceeds to bundle and upload an application revision to S3. Once uploaded this job will finally create a deployment based on that revision.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
application-name | The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account. | Yes | - | string |
arguments | If you wish to pass any additional arguments to the aws deploy command | No | '' | string |
auth | The authentication method used to access your AWS account. Import the aws-cli orb in your config and
provide the aws-cli/setup command to authenticate with your preferred method. View examples for more information.
| Yes | - | steps |
bundle-bucket | The s3 bucket where an application revision will be stored | Yes | - | string |
bundle-key | A key under the s3 bucket where an application revision will be stored | Yes | - | string |
bundle-source | The directory relative to your project to package up into an application revision. | No | . | string |
bundle-type | The file type used for an application revision bundle. Currently defaults to 'zip' | No | zip | string |
deploy-bundle-arguments | If you wish to pass any additional arguments to the deploy-bundle command | No | '' | string |
deployment-config | Predefined deployment configuration name. | No | CodeDeployDefault.OneAtATime | enum |
deployment-group | The name of a new deployment group for the specified application. | Yes | - | string |
get-deployment-group-arguments | If you wish to pass any additional arguments to the get-deployment-group command | No | '' | string |
profile-name | The name of an AWS profile to use with aws-cli commands | No | default | string |
region | AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
| No | ${AWS_DEFAULT_REGION} | string |
service-role-arn | The service role for a deployment group. | Yes | - | string |
Creates an application.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
application-name | The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account. | Yes | - | string |
arguments | If you wish to pass any additional arguments to the aws deploy command | No | '' | string |
profile-name | The name of an AWS profile to use with aws-cli commands | No | default | string |
region | AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
| No | ${AWS_DEFAULT_REGION} | string |
Creates a deployment group to which application revisions are deployed.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
application-name | The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account. | Yes | - | string |
arguments | If you wish to pass any additional arguments to the create-deployment-group command | No | '' | string |
deployment-config | Predefined deployment configuration name. | No | CodeDeployDefault.OneAtATime | enum |
deployment-group | The name of a new deployment group for the specified application. | Yes | - | string |
get-deployment-group-arguments | If you wish to pass any additional arguments to the get-deployment-group command | No | '' | string |
profile-name | The name of an AWS profile to use with aws-cli commands | No | default | string |
region | AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
| No | ${AWS_DEFAULT_REGION} | string |
service-role-arn | The service role for a deployment group. | Yes | - | string |
Deploy from a bundle and wait until the deployment has successfully completed.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
application-name | The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account. | Yes | - | string |
bundle-bucket | The s3 bucket where an application revision will be stored | Yes | - | string |
bundle-key | A key under the s3 bucket where an application revision will be stored | Yes | - | string |
bundle-type | The file type used for an application revision bundle. Currently defaults to 'zip' | No | zip | string |
deploy-bundle-arguments | If you wish to pass any additional arguments to the aws create-deployment command | No | '' | string |
deployment-config | Predefined deployment configuration name. | No | CodeDeployDefault.OneAtATime | enum |
deployment-group | The name of a new deployment group for the specified application. | Yes | - | string |
get-deployment-group-arguments | If you wish to pass any additional arguments to the get-deployment-group command | No | '' | string |
profile-name | The name of an AWS profile to use with aws-cli commands | No | default | string |
region | AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
| No | ${AWS_DEFAULT_REGION} | string |
Bundles and uploads to Amazon Simple Storage Service (Amazon S3) an application revision
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
application-name | The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account. | Yes | - | string |
arguments | If you wish to pass any additional arguments to the aws deploy command | No | '' | string |
bundle-bucket | The s3 bucket where an application revision will be stored | Yes | - | string |
bundle-key | A key under the s3 bucket where an application revision will be stored | Yes | - | string |
bundle-source | The directory relative to your project to package up into an application revision. | No | . | string |
bundle-type | The file type used for an application revision bundle. Currently defaults to 'zip' | No | zip | string |
profile-name | The name of an AWS profile to use with aws-cli commands | No | default | string |
region | AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
| No | ${AWS_DEFAULT_REGION} | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
Easily deploy applications to AWS CodeDeploy on CircleCI with the aws-code-deploy orb
display:
home_url: https://aws.amazon.com/codedeploy/
source_url: https://github.com/CircleCI-Public/aws-code-deploy-orb
commands:
create-application:
description: |
Creates an application.
parameters:
application-name:
description: The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
type: string
arguments:
default: ""
description: If you wish to pass any additional arguments to the aws deploy command
type: string
profile-name:
default: default
description: The name of an AWS profile to use with aws-cli commands
type: string
region:
default: ${AWS_DEFAULT_REGION}
description: |
AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
type: string
steps:
- run:
command: "#!/bin/sh\nORB_EVAL_APPLICATION_NAME=\"$(eval echo \"${ORB_EVAL_APPLICATION_NAME}\")\"\nORB_EVAL_REGION=\"$(eval echo \"${ORB_EVAL_REGION}\")\"\n\nset +e\naws deploy get-application \\\n --application-name \"${ORB_EVAL_APPLICATION_NAME}\" --profile \"${ORB_VAL_PROFILE_NAME}\" --region \"${ORB_EVAL_REGION}\" \\\n \"${ORB_VAL_ARGUMENTS}\" \nif $? -ne 0; then\n set -e\n echo \"No application named ${ORB_EVAL_APPLICATION_NAME} found. Trying to create a new one\"\nelse\n set -e\n echo \"Application named ${ORB_EVAL_APPLICATION_NAME} already exists. Skipping creation.\"\nfi\n"
environment:
ORB_EVAL_APPLICATION_NAME: << parameters.application-name >>
ORB_EVAL_REGION: << parameters.region >>
ORB_VAL_ARGUMENTS: << parameters.arguments >>
ORB_VAL_PROFILE_NAME: << parameters.profile-name >>
name: ensure-application-created
create-deployment-group:
description: |
Creates a deployment group to which application revisions are deployed.
parameters:
application-name:
description: The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
type: string
arguments:
default: ""
description: If you wish to pass any additional arguments to the create-deployment-group command
type: string
deployment-config:
default: CodeDeployDefault.OneAtATime
description: Predefined deployment configuration name.
enum:
- CodeDeployDefault.OneAtATime
- CodeDeployDefault.HalfAtATime
- CodeDeployDefault.AllAtOnce
type: enum
deployment-group:
description: The name of a new deployment group for the specified application.
type: string
get-deployment-group-arguments:
default: ""
description: If you wish to pass any additional arguments to the get-deployment-group command
type: string
profile-name:
default: default
description: The name of an AWS profile to use with aws-cli commands
type: string
region:
default: ${AWS_DEFAULT_REGION}
description: |
AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
type: string
service-role-arn:
description: The service role for a deployment group.
type: string
steps:
- run:
command: |+
#!/bin/sh
ORB_EVAL_APPLICATION_NAME="$(eval echo "${ORB_EVAL_APPLICATION_NAME}")"
ORB_EVAL_DEPLOYMENT_GROUP="$(eval echo "${ORB_EVAL_DEPLOYMENT_GROUP}")"
ORB_EVAL_REGION="$(eval echo "${ORB_EVAL_REGION}")"
set +e
aws deploy get-deployment-group \
--application-name "${ORB_EVAL_APPLICATION_NAME}" \
--deployment-group-name "${ORB_EVAL_DEPLOYMENT_GROUP}" \
--region "${ORB_EVAL_REGION}" \
--profile "${ORB_VAL_PROFILE_NAME}" "${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}"
if $? -ne 0; then
set -e
echo "No deployment group named ${ORB_EVAL_DEPLOYMENT_GROUP} found. Trying to create a new one"
aws deploy create-deployment-group \
--application-name "${ORB_EVAL_APPLICATION_NAME}" \
--deployment-group-name "${ORB_EVAL_DEPLOYMENT_GROUP}" \
--deployment-config-name "${ORB_VAL_DEPLOYMENT_CONFIG}" \
--service-role-arn "${ORB_VAL_SERVICE_ROLE_ARN}" "${ORB_VAL_ARGUMENTS}"
else
set -e
echo "Deployment group named ${ORB_EVAL_DEPLOYMENT_GROUP} already exists. Skipping creation."
fi
environment:
ORB_EVAL_APPLICATION_NAME: << parameters.application-name >>
ORB_EVAL_DEPLOYMENT_GROUP: << parameters.deployment-group >>
ORB_EVAL_REGION: << parameters.region >>
ORB_VAL_ARGUMENTS: << parameters.arguments >>
ORB_VAL_DEPLOYMENT_CONFIG: << parameters.deployment-config >>
ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS: << parameters.get-deployment-group-arguments >>
ORB_VAL_PROFILE_NAME: << parameters.profile-name >>
ORB_VAL_SERVICE_ROLE_ARN: << parameters.service-role-arn >>
name: ensure-deployment-created
deploy-bundle:
description: |
Deploy from a bundle and wait until the deployment has successfully completed.
parameters:
application-name:
description: The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
type: string
bundle-bucket:
description: The s3 bucket where an application revision will be stored
type: string
bundle-key:
description: A key under the s3 bucket where an application revision will be stored
type: string
bundle-type:
default: zip
description: The file type used for an application revision bundle. Currently defaults to 'zip'
type: string
deploy-bundle-arguments:
default: ""
description: If you wish to pass any additional arguments to the aws create-deployment command
type: string
deployment-config:
default: CodeDeployDefault.OneAtATime
description: Predefined deployment configuration name.
enum:
- CodeDeployDefault.OneAtATime
- CodeDeployDefault.HalfAtATime
- CodeDeployDefault.AllAtOnce
type: enum
deployment-group:
description: The name of a new deployment group for the specified application.
type: string
get-deployment-group-arguments:
default: ""
description: If you wish to pass any additional arguments to the get-deployment-group command
type: string
profile-name:
default: default
description: The name of an AWS profile to use with aws-cli commands
type: string
region:
default: ${AWS_DEFAULT_REGION}
description: |
AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
type: string
steps:
- run:
command: "#!/bin/sh\nORB_EVAL_APPLICATION_NAME=\"$(eval echo \"${ORB_EVAL_APPLICATION_NAME}\")\"\nORB_EVAL_DEPLOYMENT_GROUP=\"$(eval echo \"${ORB_EVAL_DEPLOYMENT_GROUP}\")\"\nORB_EVAL_BUNDLE_BUCKET=\"$(eval echo \"${ORB_EVAL_BUNDLE_BUCKET}\")\"\nORB_EVAL_BUNDLE_KEY=\"$(eval echo \"${ORB_EVAL_BUNDLE_KEY}\")\"\nORB_EVAL_REGION=\"$(eval echo \"${ORB_EVAL_REGION}\")\"\n\nif [ -n \"${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}\" ]; then \n set -- \"$@\" \"${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}\"\nfi\n\nif [ -n \"${ORB_VAL_DEPLOY_BUNDLE_ARGUMENTS}\" ]; then\n set -- \"$@\" \"${ORB_VAL_DEPLOY_BUNDLE_ARGUMENTS}\"\nfi \n\nID=$(aws deploy create-deployment \\\n --application-name \"${ORB_EVAL_APPLICATION_NAME}\" \\\n --deployment-group-name \"${ORB_EVAL_DEPLOYMENT_GROUP}\" \\\n --deployment-config-name \"${ORB_VAL_DEPLOYMENT_CONFIG}\" \\\n --region \"${ORB_EVAL_REGION}\" \\\n --s3-location bucket=\"${ORB_EVAL_BUNDLE_BUCKET}\",bundleType=\"${ORB_VAL_BUNDLE_TYPE}\",key=\"${ORB_EVAL_BUNDLE_KEY}\".\"${ORB_VAL_BUNDLE_TYPE}\" \\\n --profile \"${ORB_VAL_PROFILE_NAME}\" \\\n --output text \\\n --query '[deploymentId]' \"${ORB_VAL_DEPLOY_BUNDLE_ARGUMENTS}\")\nSTATUS=$(aws deploy get-deployment \\\n --deployment-id \"$ID\" \\\n --output text \\\n --profile \"${ORB_VAL_PROFILE_NAME}\" \\\n --region \"${ORB_EVAL_REGION}\" \\\n --query '[deploymentInfo.status]' \\\n \"${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}\")\nwhile [ \"$STATUS\" = \"Created\" ] || [ \"$STATUS\" = \"InProgress\" ] || [ \"$STATUS\" = \"Pending\" ] || [ \"$STATUS\" = \"Queued\" ] || [ \"$STATUS\" = \"Ready\" ]; do\n echo \"Status: $STATUS...\"\n STATUS=$(aws deploy get-deployment \\\n --deployment-id \"$ID\" \\\n --profile \"${ORB_VAL_PROFILE_NAME}\" \\\n --region \"${ORB_EVAL_REGION}\" \\\n --output text \\\n --query '[deploymentInfo.status]'\"${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}\")\n sleep 5\ndone\nif [ \"$STATUS\" = \"Succeeded\" ]; then\n EXITCODE=0\n echo \"Deployment finished.\"\nelse\n EXITCODE=1\n echo \"Deployment failed!\"\nfi\naws deploy get-deployment --deployment-id \"$ID\" \\\n\"${ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS}\" \\\n--profile \"${ORB_VAL_PROFILE_NAME}\" \\\n--region \"${ORB_EVAL_REGION}\" \\\n--profile \"${ORB_VAL_PROFILE_NAME}\"\nexit $EXITCODE\n"
environment:
ORB_EVAL_APPLICATION_NAME: << parameters.application-name >>
ORB_EVAL_BUNDLE_BUCKET: << parameters.bundle-bucket >>
ORB_EVAL_BUNDLE_KEY: << parameters.bundle-key >>
ORB_EVAL_DEPLOYMENT_GROUP: << parameters.deployment-group >>
ORB_EVAL_REGION: << parameters.region >>
ORB_VAL_BUNDLE_TYPE: << parameters.bundle-type >>
ORB_VAL_DEPLOY_BUNDLE_ARGUMENTS: << parameters.deploy-bundle-arguments >>
ORB_VAL_DEPLOYMENT_CONFIG: << parameters.deployment-config >>
ORB_VAL_GET_DEPLOYMENT_GROUP_ARGUMENTS: << parameters.get-deployment-group-arguments >>
ORB_VAL_PROFILE_NAME: << parameters.profile-name >>
name: deploy-bundle
push-bundle:
description: |
Bundles and uploads to Amazon Simple Storage Service (Amazon S3) an application revision
parameters:
application-name:
description: The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
type: string
arguments:
default: ""
description: If you wish to pass any additional arguments to the aws deploy command
type: string
bundle-bucket:
description: The s3 bucket where an application revision will be stored
type: string
bundle-key:
description: A key under the s3 bucket where an application revision will be stored
type: string
bundle-source:
default: .
description: The directory relative to your project to package up into an application revision.
type: string
bundle-type:
default: zip
description: The file type used for an application revision bundle. Currently defaults to 'zip'
type: string
profile-name:
default: default
description: The name of an AWS profile to use with aws-cli commands
type: string
region:
default: ${AWS_DEFAULT_REGION}
description: |
AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
type: string
steps:
- run:
command: "#!/bin/sh\nORB_EVAL_APPLICATION_NAME=\"$(eval echo \"${ORB_EVAL_APPLICATION_NAME}\")\"\nORB_EVAL_BUNDLE_BUCKET=\"$(eval echo \"${ORB_EVAL_BUNDLE_BUCKET}\")\"\nORB_EVAL_BUNDLE_KEY=\"$(eval echo \"${ORB_EVAL_BUNDLE_KEY}\")\"\nORB_EVAL_REGION=\"$(eval echo \"${ORB_EVAL_REGION}\")\"\n\nif [ -n \"${ORB_VAL_ARGUMENTS}\" ]; then \n set -- \"$@\" \"${ORB_VAL_ARGUMENTS}\"\nfi \n\naws deploy push \\\n --application-name \"${ORB_EVAL_APPLICATION_NAME}\" \\\n --source \"${ORB_VAL_BUNDLE_SOURCE}\" \\\n --profile \"${ORB_VAL_PROFILE_NAME}\" \\\n --region \"${ORB_EVAL_REGION}\" \\\n --s3-location s3://\"${ORB_EVAL_BUNDLE_BUCKET}/${ORB_EVAL_BUNDLE_KEY}.${ORB_VAL_BUNDLE_TYPE}\" \"$@\"\n"
environment:
ORB_EVAL_APPLICATION_NAME: << parameters.application-name >>
ORB_EVAL_BUNDLE_BUCKET: << parameters.bundle-bucket >>
ORB_EVAL_BUNDLE_KEY: << parameters.bundle-key >>
ORB_EVAL_REGION: << parameters.region >>
ORB_VAL_ARGUMENTS: << parameters.arguments >>
ORB_VAL_BUNDLE_SOURCE: << parameters.bundle-source >>
ORB_VAL_BUNDLE_TYPE: << parameters.bundle-type >>
ORB_VAL_PROFILE_NAME: << parameters.profile-name >>
name: push-bundle
jobs:
deploy:
description: |
Ensures an application and deployment group exist then proceeds to
bundle and upload an application revision to S3. Once uploaded this
job will finally create a deployment based on that revision.
docker:
- image: cimg/aws:2023.03
parameters:
application-name:
description: The name of an AWS CodeDeploy application associated with the applicable IAM user or AWS account.
type: string
arguments:
default: ""
description: If you wish to pass any additional arguments to the aws deploy command
type: string
auth:
description: |
The authentication method used to access your AWS account. Import the aws-cli orb in your config and
provide the aws-cli/setup command to authenticate with your preferred method. View examples for more information.
type: steps
bundle-bucket:
description: The s3 bucket where an application revision will be stored
type: string
bundle-key:
description: A key under the s3 bucket where an application revision will be stored
type: string
bundle-source:
default: .
description: The directory relative to your project to package up into an application revision.
type: string
bundle-type:
default: zip
description: The file type used for an application revision bundle. Currently defaults to 'zip'
type: string
deploy-bundle-arguments:
default: ""
description: If you wish to pass any additional arguments to the deploy-bundle command
type: string
deployment-config:
default: CodeDeployDefault.OneAtATime
description: Predefined deployment configuration name.
enum:
- CodeDeployDefault.OneAtATime
- CodeDeployDefault.HalfAtATime
- CodeDeployDefault.AllAtOnce
type: enum
deployment-group:
description: The name of a new deployment group for the specified application.
type: string
get-deployment-group-arguments:
default: ""
description: If you wish to pass any additional arguments to the get-deployment-group command
type: string
profile-name:
default: default
description: The name of an AWS profile to use with aws-cli commands
type: string
region:
default: ${AWS_DEFAULT_REGION}
description: |
AWS region of CodeDeploy App. Defaults to environment variable ${AWS_DEFAULT_REGION}.
type: string
service-role-arn:
description: The service role for a deployment group.
type: string
steps:
- checkout
- steps: << parameters.auth >>
- create-application:
application-name: << parameters.application-name >>
arguments: << parameters.arguments >>
profile-name: << parameters.profile-name >>
region: << parameters.region >>
- create-deployment-group:
application-name: << parameters.application-name >>
arguments: << parameters.arguments >>
deployment-config: << parameters.deployment-config >>
deployment-group: << parameters.deployment-group >>
get-deployment-group-arguments: << parameters.get-deployment-group-arguments >>
profile-name: << parameters.profile-name >>
region: << parameters.region >>
service-role-arn: << parameters.service-role-arn >>
- push-bundle:
application-name: << parameters.application-name >>
arguments: << parameters.arguments >>
bundle-bucket: << parameters.bundle-bucket >>
bundle-key: << parameters.bundle-key >>
bundle-source: << parameters.bundle-source >>
bundle-type: << parameters.bundle-type >>
profile-name: << parameters.profile-name >>
region: << parameters.region >>
- deploy-bundle:
application-name: << parameters.application-name >>
bundle-bucket: << parameters.bundle-bucket >>
bundle-key: << parameters.bundle-key >>
bundle-type: << parameters.bundle-type >>
deploy-bundle-arguments: << parameters.deploy-bundle-arguments >>
deployment-config: << parameters.deployment-config >>
deployment-group: << parameters.deployment-group >>
get-deployment-group-arguments: << parameters.get-deployment-group-arguments >>
profile-name: << parameters.profile-name >>
region: << parameters.region >>
examples:
deploy_application:
description: |
Deploy an application to AWS CodeDeploy using static AWS keys for authentication. Import the aws-cli orb and authenticate using the aws-cli/setup command with static AWS keys stored as env_vars (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).
usage:
version: "2.1"
orbs:
aws-cli: circleci/aws-cli@3.1
aws-code-deploy: circleci/aws-code-deploy@3.0
workflows:
deploy_application:
jobs:
- aws-code-deploy/deploy:
application-name: myApplication
auth:
- aws-cli/setup
bundle-bucket: myApplicationS3Bucket
bundle-key: myS3BucketKey
deployment-group: myDeploymentGroup
service-role-arn: myDeploymentGroupRoleARN
deploy_application_with_oidc:
description: |
Deploy an application to AWS CodeDeploy using OIDC authentication. Import the aws-cli orb and authenticate using the aws-cli/setup command with a valid role-arn for OIDC authentication.
usage:
version: "2.1"
orbs:
aws-cli: circleci/aws-cli@3.1
aws-code-deploy: circleci/aws-code-deploy@3.0
workflows:
deploy_application:
jobs:
- aws-code-deploy/deploy:
application-name: myApplication
auth:
- aws-cli/setup:
profile: OIDC-USER
role-arn: arn:aws:iam::123456789012:role/VALID_OIDC_CODEDEPLOY_ROLE
bundle-bucket: myApplicationS3Bucket
bundle-key: myS3BucketKey
context: CircleCI_OIDC_Token
deployment-group: myDeploymentGroup
profile: OIDC-USER
service-role-arn: myDeploymentGroupRoleARN