-
Notifications
You must be signed in to change notification settings - Fork 5
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
CloudFormation Ref
s do not always map to the CCAPI id
#173
Comments
corymhall
added
kind/bug
Some behavior is incorrect or out of spec
needs-triage
Needs attention from the triage team
and removed
needs-triage
Needs attention from the triage team
labels
Oct 14, 2024
Added to epic https://github.com/pulumi/home/issues/2191 |
Related: pulumi/pulumi-aws-native#1662 |
corymhall
added a commit
that referenced
this issue
Oct 28, 2024
This PR adds some additional examples taken from [cdk patterns](https://cdkpatterns.com/). It adds coverage for these additional resources. ``` aws-native:sns:Topic aws-native:sns:Subscription aws-native:lambda:EventSourceMapping aws:lambda:Permission aws-native:iam:Role aws-native:apigateway:Model aws-native:apigateway:RestApi aws-native:apigateway:Deployment aws-native:apigateway:Stage aws-native:apigateway:Method aws-native:apigateway:Resource aws-native:sqs:Queue aws:sqs:QueuePolicy aws-native:events:Rule aws-native:dynamodb:GlobalTable ``` I am also introducing a workaround for #173 for a couple of the ApiGateway resources since those are top 20 library resources. We can easily remove this workaround once the complete fix done.
corymhall
added a commit
that referenced
this issue
Oct 29, 2024
This PR adds some additional examples taken from [cdk patterns](https://cdkpatterns.com/). It adds coverage for these additional resources. ``` aws-native:sns:Topic aws-native:sns:Subscription aws-native:lambda:EventSourceMapping aws:lambda:Permission aws-native:iam:Role aws-native:apigateway:Model aws-native:apigateway:RestApi aws-native:apigateway:Deployment aws-native:apigateway:Stage aws-native:apigateway:Method aws-native:apigateway:Resource aws-native:sqs:Queue aws:sqs:QueuePolicy aws-native:events:Rule aws-native:dynamodb:GlobalTable ``` I am also introducing a workaround for #173 for a couple of the ApiGateway resources since those are top 20 library resources. We can easily remove this workaround once the complete fix done.
Possibly related: pulumi/pulumi-aws-native#1734 |
This was referenced Nov 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
CloudFormation has two ways of referencing attributes from a Resource. You can either use Ref or Fn::GetAtt.
The
Ref
is essentially a shortcut to get you the attribute that represents the CloudFormationId
of the resource. In the case of this library we are converting CloudFormation to CCAPI and we are currently assuming that the CloudFormationRef
is always the same as the CCAPIIdentifier
, but it turns out that is not always the case, especially for resources that have a CCAPIIdentifier
made up of multiple attributes.Example
Take this CloudFormation template.
The
ResourceId
property of theAWS::ApiGateway::Method
resource uses aRef
to theAWS::ApiGateway::Resource
resource. CloudFormation will return theResourceId
fromRef
. If we look at wha the CCAPI resource looks like:The
Identifier
is a reference to the primaryIdentifier which is a composite id made up of the${RestApiId}|${ResourceId}
and is not the same as what will be returned by CloudFormationRef
.For the
Method
resource, the CCAPIIdentifier
is not the correct value for theResourceId
property. It should be using theResourceId
attribute of theResource
resource.Output of
pulumi about
N/A
Additional context
If we had access to the CloudFormation schema for the
AWS::ApiGateway::Resource
resourcehttps://github.com/pulumi/pulumi-aws-native/blob/cf710320d32c3b59067b81582ba8ff239bc4e452/aws-cloudformation-schema/aws-apigateway-resource.json#L31-L36
We may be able to make an assumption that if the
primaryIdentifier
is a composite identifier then we only take those values that also exist in thereadOnlyAttributes
.Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: