Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ecs): add a portMappings prop to ContainerDefinition #13261

Assignees
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container feature-request A feature should be added or improved.

Comments

@misterjoshua
Copy link
Contributor

I'd like to allow the user to define port mappings when adding containers to a task definition.

Use Case

This would allow users to add containers in a more declarative fashion.

Proposed Solution

Add an optional portMappings prop to ContainerDefinitionOptions and have ContainerDefinition add the port mappings at construction time. After, I'd be able to do this:

taskDefinition.addContainer('cont', {
  image: ecs.ContainerImage.fromRegistry('test'),
  memoryLimitMiB: 1024,
  // New option:
  portMappings: [{ containerPort: 80 }],
});
  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@misterjoshua misterjoshua added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 24, 2021
@peterwoodworth peterwoodworth added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Feb 24, 2021
@mergify mergify bot closed this as completed in #13262 Feb 26, 2021
mergify bot pushed a commit that referenced this issue Feb 26, 2021
This PR adds an optional `portMappings` property to `ContainerDefinitionOptions` so that users can add port mappings when they add a container to a `TaskDefinition`.

Closes #13261

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@SoManyHs SoManyHs removed the needs-triage This issue or PR still needs to be triaged. label Mar 4, 2021
This was referenced Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment