Skip to content

Commit

Permalink
Use the stack-name in the Name property of the ContainerDefinition (#…
Browse files Browse the repository at this point in the history
…226)

* allow for options.service to be a reference

* update snapshots

* use cf.stackName directly
  • Loading branch information
S Aruna committed Jun 21, 2018
1 parent 1a9df58 commit 783a9e4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ module.exports = (options = {}) => {
Family: options.family,
ContainerDefinitions: [
{
Name: prefixed(`-${options.service}`).toLowerCase(),
Name: cf.join('-', [prefixed(''), cf.stackName]),
Image: cf.join([
cf.accountId,
'.dkr.ecr.us-east-1.amazonaws.com/',
Expand Down
24 changes: 22 additions & 2 deletions test/__snapshots__/template.jest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,17 @@ Object {
"SourceVolume": "mnt-1",
},
],
"Name": "soup-example",
"Name": Object {
"Fn::Join": Array [
"-",
Array [
"Soup",
Object {
"Ref": "AWS::StackName",
},
],
],
},
"Privileged": true,
"ReadonlyRootFilesystem": true,
"Ulimits": Array [
Expand Down Expand Up @@ -1249,7 +1259,17 @@ Object {
"SourceVolume": "tmp",
},
],
"Name": "watchbot-example",
"Name": Object {
"Fn::Join": Array [
"-",
Array [
"Watchbot",
Object {
"Ref": "AWS::StackName",
},
],
],
},
"Privileged": false,
"ReadonlyRootFilesystem": true,
"Ulimits": Array [
Expand Down

0 comments on commit 783a9e4

Please sign in to comment.