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

feat(core): CfnJson enables intrinsics in hash keys #8099

Merged
merged 4 commits into from
May 21, 2020
Merged

Conversation

eladb
Copy link
Contributor

@eladb eladb commented May 20, 2020

Rarely there is a need to use a CloudFormation intrinsic in a JSON hash key. This is impossible since intrinsics are not strings. To circumvent that, CfnJson can be used to "delay" the rendition of the object using a simple custom resource
which simply parses and reflects the input value as an attribute.

Required in order to implement EKS IRSA (#8084) and other federated identity use cases.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Rarely there is a need to use a CloudFormation intrinsic in a JSON hash key. This is impossible since intrinsics are not strings. To circumvent that, CfnJson can be used to "delay" the rendition of the object using a simple custom resource
which simply parses and reflects the input value as an attribute.

Required in order to implement EKS IRSA (#8084) and other federated identity use cases.
@eladb eladb requested review from rix0rrr and a team May 20, 2020 12:46
@eladb eladb changed the title feat(core): introduce CfnJson to enable intrinsics in hash keys feat(core): CfnJson enables intrinsics in hash keys May 20, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label May 20, 2020
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: e1bbf37
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we take this all the way?

@rix0rrr rix0rrr dismissed their stale review May 20, 2020 15:50

I'm an idiot

@eladb
Copy link
Contributor Author

eladb commented May 20, 2020

I'm an idiot

LOL

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: d131ae3
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@eladb eladb requested a review from rix0rrr May 20, 2020 19:51
In order to allow for adding additional future resources, I extracted the resource provider to be slightly more generic.
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: d83bb7b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 34fa2ea
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented May 21, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 195cd40 into master May 21, 2020
@mergify mergify bot deleted the benisrae/cfn-json branch May 21, 2020 08:38
karupanerura pushed a commit to karupanerura/aws-cdk that referenced this pull request May 22, 2020
Rarely there is a need to use a CloudFormation intrinsic in a JSON hash key. This is impossible since intrinsics are not strings. To circumvent that, CfnJson can be used to "delay" the rendition of the object using a simple custom resource
which simply parses and reflects the input value as an attribute.

Required in order to implement EKS IRSA (aws#8084) and other federated identity use cases.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants