-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
apigatewayv2: Error referencing integration_id when creating route #30512
Comments
I see you are creating the integration with CfnIntegration L1 construct, and according to the api ref doc, you should have attr_id. get_cases_integration = apigwv2.CfnIntegration(...) I can reproduce this in TS: // create a minimal integration
const cfnintegration = new apigwv2.CfnIntegration(this, 'dummy', {
apiId: 'dummy-id',
integrationType: 'AWS_PROXY',
integrationUri: 'dummy-uri',
});
new CfnOutput(this, 'dummy-uri', { value: cfnintegration.attrId }); CFN {
"Resources": {
"dummy": {
"Type": "AWS::ApiGatewayV2::Integration",
"Properties": {
"ApiId": "dummy-id",
"IntegrationType": "AWS_PROXY",
"IntegrationUri": "dummy-uri"
},
"Metadata": {
"aws:cdk:path": "stack1/dummy"
}
},
"CDKMetadata": {
"Type": "AWS::CDK::Metadata",
"Properties": {
"Analytics": "v2:deflate64:H4sIAAAAAAAA/yWNwQrCMBBEv8V7upqi4r0nT0L9AFmTtWyrm5JsWkT8dxM8zZvHwLRg9wfYbXBNjfNT8+Q7fK6KbjJF3XDmAZVWfC8tdA85i9IQUTmIKfWSdc5aqacUcnRUuQviuU6+RoInGNN2sSewx/IzJuYmZlF+EfT//AEunruFhAAAAA=="
},
"Metadata": {
"aws:cdk:path": "stack1/CDKMetadata/Default"
},
"Condition": "CDKMetadataAvailable"
}
},
"Outputs": {
"dummyuri": {
"Value": {
"Fn::GetAtt": [
"dummy",
"Id"
]
}
}
},
"Conditions": {
"CDKMetadataAvailable": {
"Fn::Or": [
{
"Fn::Or": [
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"af-south-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-east-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-northeast-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-northeast-2"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-south-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-southeast-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ap-southeast-2"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"ca-central-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"cn-north-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"cn-northwest-1"
]
}
]
},
{
"Fn::Or": [
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-central-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-north-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-south-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-west-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-west-2"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"eu-west-3"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"il-central-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"me-central-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"me-south-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"sa-east-1"
]
}
]
},
{
"Fn::Or": [
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"us-east-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"us-east-2"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"us-west-1"
]
},
{
"Fn::Equals": [
{
"Ref": "AWS::Region"
},
"us-west-2"
]
}
]
}
]
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
} ❌ Deployment failed: Error: The stack named stack1 failed to deploy: CREATE_FAILED ([Error] /Outputs/dummyuri/Value/Fn::GetAtt: Resource type AWS::ApiGatewayV2::Integration does not support attribute {Id}) This looks like a CFN bug. I'll report internally. |
Awesome thanks! |
Internal tracking: V1416216620 P135346098 |
We are still pending for internal response. Before we get it sorted, you probably need to use Ref like |
Describe the bug
When creating an integration for a websocket api to create a route you need to have the id of the integration you want to attach, but there are errors that prevent deployment.
This is the error I am getting from referencing get_cases_integration.attr_id:
[Error] /Resources/TestGetCasesRoute/Properties/Target/Fn::Join/1/1/Fn::GetAtt: Resource type AWS::ApiGatewayV2::Integration does not support attribute {Id}
attr_id is shown as an attribute I should be able to use in the documentation here: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_apigatewayv2/CfnIntegration.html
and id is shown in the cloudformation docs as well
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-integration.html
Actually using the attribute results in an error though.
Hardcoding the target works fine as shown in the second commented out target in the route.
Expected Behavior
I should be able to get the integration id for use with the route.
Current Behavior
The attribute I am trying to use is invalid (attr_id)
Reproduction Steps
Use above code.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.145.0 (build fdf53ba)
Framework Version
No response
Node.js Version
v20.14.0
OS
Ubuntu 24.04
Language
Python
Language Version
Python 3.12.3
Other information
No response
The text was updated successfully, but these errors were encountered: