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

Create example of getting a reference to a resource by tag value #1990

Closed
Doug-AWS opened this issue Mar 11, 2019 · 2 comments
Closed

Create example of getting a reference to a resource by tag value #1990

Doug-AWS opened this issue Mar 11, 2019 · 2 comments
Assignees
Labels
docs/guide Related to the developer guide needs-reproduction This issue needs reproduction. p2

Comments

@Doug-AWS
Copy link
Contributor

User wrote:

I'm trying to get a subnetId with a tag (actually the tag is applied by creation through CDK, so it's especially troublesome to not be able to find this).

In this example, you show how to apply a tag, but not how to find a resource with a Tag. Presently, I need to replace something like the following in the AWS SDK:

Filter filter = new Filter().withName("vpc-id").withValues(vpcId).withName("tag:Name").withValues("infraStack/CodeBuild VPC/PrivateSubnet1");

DescribeSubnetsRequest describeSubnetsRequest = new DescribeSubnetsRequest().withFilters(filter);

String subnetId = null;

try {
    subnetId = getClient().describeSubnets(describeSubnetsRequest).getSubnets().iterator().next().getSubnetId();

Right now CDK doesn't necessarily have API or user guide documentation on how to do this--or I'm not finding it.

@Doug-AWS Doug-AWS self-assigned this Mar 11, 2019
@Doug-AWS Doug-AWS added documentation p2 docs/guide Related to the developer guide labels Mar 11, 2019
@Doug-AWS
Copy link
Contributor Author

@Doug-AWS Doug-AWS changed the title Create example of getting a subnet ID tag Create example of getting a reference to a resource by tag value Mar 11, 2019
@Doug-AWS Doug-AWS added needs-discussion This issue/PR requires more discussion with community. needs-contributors and removed needs-discussion This issue/PR requires more discussion with community. labels Mar 11, 2019
@Doug-AWS
Copy link
Contributor Author

Moving guide issues to doc repo.

@SomayaB SomayaB added needs-reproduction This issue needs reproduction. and removed status/needs-sample labels Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs/guide Related to the developer guide needs-reproduction This issue needs reproduction. p2
Projects
None yet
Development

No branches or pull requests

2 participants