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

Version reporting is not working for env-agnostic stacks #3142

Closed
1 task done
jogold opened this issue Jul 1, 2019 · 3 comments · Fixed by #3149 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Assignees
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug.

Comments

@jogold
Copy link
Contributor

jogold commented Jul 1, 2019

  • I'm submitting a ...

    • 🪲 bug report
  • What is the current behavior?
    When working/deploying env-agnostic stacks version reporting is not working (AWS::CDK::Metadata is never deployed). This is because the check for the fact CDK_METADATA_RESOURCE_AVAILABLE fails (region is unknown).

  • What is the expected behavior (or behavior of feature suggested)?
    Version reporting should work for env-agnostic stacks. The version reporting check should use the deploy time resolved region.

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0
    • Module Version: 0.36.0
    • Language: all
@jogold jogold added the needs-triage This issue or PR still needs to be triaged. label Jul 1, 2019
@eladb
Copy link
Contributor

eladb commented Jul 1, 2019

Wow, @jogold thanks for reporting this. Nice catch!

@eladb eladb added bug This issue is a bug. and removed needs-triage This issue or PR still needs to be triaged. labels Jul 1, 2019
@jogold
Copy link
Contributor Author

jogold commented Jul 1, 2019

Just found out because I have one of my cdk stacks that is creating only one resource via route53.HostedZone.fromHostedZoneAttributes. In the long term it will of course create and own a route53 hosted zone resource but this solution was easier for quick migration (the code/stack structure is already there and it allows to start already with cross-stack references).

Previously this stack deployed fine because the template contained a AWS::CDK::Metadata resource, now I'm getting a CF validation error ValidationError: Template format error: At least one Resources member must be defined.

May I open a PR to skip deploying stacks without resources? via filter in selectStacks
https://github.com/awslabs/aws-cdk/blob/9d19aef869f27001ed88189fd277aa721de29886/packages/aws-cdk/lib/api/cxapp/stacks.ts#L106

@eladb
Copy link
Contributor

eladb commented Jul 1, 2019

May I open a PR to skip deploying stacks without resources? via filter in selectStacks

Why not? Sounds good. Issue a warning?

RomainMuller added a commit that referenced this issue Jul 1, 2019
Fixes a bug that caused the CDK Metadata resource to not be emitted if a
stack was not bound to a particular supported region. The fixed behavior
will generate the resource for supported regions as well as for region
independent stacks.

Fixes #3142
@NGL321 NGL321 added the @aws-cdk/core Related to core CDK functionality label Jul 1, 2019
RomainMuller added a commit that referenced this issue Jul 2, 2019
…ks (#3149)

Fixes a bug that caused the CDK Metadata resource to not be emitted if a
stack was not bound to a particular supported region. The fixed behavior
will generate the resource for supported regions as well as for region
independent stacks.

Fixes #3142
Kaixiang-AWS pushed a commit to Kaixiang-AWS/aws-cdk that referenced this issue Jul 3, 2019
…ks (aws#3149)

Fixes a bug that caused the CDK Metadata resource to not be emitted if a
stack was not bound to a particular supported region. The fixed behavior
will generate the resource for supported regions as well as for region
independent stacks.

Fixes aws#3142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment