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

(aws_cdk.aws_ec2/CfnTransitGatewayAttachment): parameters in OptionsProperty are not supported #27344

Closed
shawnxue opened this issue Sep 28, 2023 · 2 comments
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud

Comments

@shawnxue
Copy link

Describe the bug

When attaching a vpc to transit gateway in AWS CDK (python), we found that keys in OptionsProperty are not supported.
CDK version: aws-cdk-lib==2.93.0
Here is our code

tgw_vpc = CfnTransitGatewayAttachment(
            self,
            "attachVPCToTransitGateway",
            subnet_ids=my_vpc.select_subnets(subnet_group_name='private_subnet').subnet_ids,
            transit_gateway_id=my_tgw.attr_id,
            vpc_id=my_vpc.vpc_id,
            options=CfnTransitGatewayAttachment.OptionsProperty(
                appliance_mode_support="disable",
                dns_support="enable",
                ipv6_support="disable"
            )
        )

Errors we got:

#/Options: extraneous key [dnsSupport] is not permitted
#/Options: extraneous key [ipv6Support] is not permitted
#/Options: extraneous key [applianceModeSupport] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:467:10232)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:470:179911)
    at async /opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:470:163159

Expected Behavior

parameters in OptionsProperty are supported.

Current Behavior

We got errors when applying the code:
Errors we got:

#/Options: extraneous key [dnsSupport] is not permitted
#/Options: extraneous key [ipv6Support] is not permitted
#/Options: extraneous key [applianceModeSupport] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:467:10232)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:470:179911)
    at async /opt/hostedtoolcache/node/18.0.0/x64/lib/node_modules/aws-cdk/lib/index.js:470:163159

Reproduction Steps

  1. create a transit gateway with CfnTransitGateway
  2. create a transit gateway attachment with CfnTransitGatewayAttachment
  3. apply the code with cdk deploy
  4. You will get the errors above.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.86.0 (build 1130fab)

Framework Version

No response

Node.js Version

18.0.0

OS

22.04 LTS

Language

Python

Language Version

3.9

Other information

No response

@shawnxue shawnxue added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Sep 28, 2023
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Sep 28, 2023

Options takes in any, not OptionsProperty. Fill it out directly without that (and be sure to PascalCase the keys) and this will work fine.

Ping me if you need to see an example of this

@peterwoodworth peterwoodworth removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2023
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud
Projects
None yet
Development

No branches or pull requests

2 participants