Last active
January 23, 2021 01:35
-
-
Save negz/64ae8854f82488556f57b72d8e1dec1e to your computer and use it in GitHub Desktop.
String transform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- base: | |
apiVersion: identity.aws.crossplane.io/v1alpha1 | |
kind: IAMPolicy | |
spec: | |
forProvider: | |
description: "policy to access dynamodb table." | |
patches: | |
- type: PatchSet | |
patchSetName: Metadata | |
- fromFieldPath: "metadata.name" | |
toFieldPath: "spec.forProvider.name" | |
- fromFieldPath: "spec.tableName" # Change as needed. | |
toFieldPath: "spec.forProvider.document" | |
transforms: | |
# Note the '%s' string format verb gets replaced with the | |
# content of spec.tableName (i.e. the fromFieldPath). | |
- type: string | |
string: | |
fmt: | | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"dynamodb:DescribeTable", | |
"dynamodb:Get*", | |
"dynamodb:PutItem" | |
], | |
"Resource": [ | |
"arn:aws:dynamodb:*:*:table/%s*" | |
], | |
"Effect": "Allow" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment