-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-iam): StringParameter.value_from_lookup's dummy value did not suffice #8699
Copy link
Copy link
Closed
Closed
Copy link
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1
Description
aws_iam.StringParameter.value_from_lookup(...)returns a dummy-value-for-${parameterName} during synthesis (from #3654). This value did not suffice for use as ARN. The dummy value itself should represent a dummy ARN pattern to avoid errors.
Reproduction Steps
Here is a short (and stripped) example, which currently leads to an error:
aws_kms.Key.from_key_arn(
self,
id,
key_arn=aws_ssm.StringParameter.value_from_lookup(
self,
parameter_name="/example/param",
),
)Error Log
During synthesis this leads to an error:
jsii.errors.JSIIError: ARNs must have at least 6 components: dummy-value-for-/example/paramWorkaround
_param = aws_ssm.StringParameter.value_from_lookup(self, parameter_name="/example/param")
if "dummy-value" in _param:
_param = "arn:aws:service:eu-central-1:123456789012:entity/dummy-value"
aws_kms.Key.from_key_arn(
self,
id,
key_arn=_param,
)Solution Proposal
Instead of dummy-value-for-${parameterName} the method should return something like arn:aws:service:eu-central-1:123456789012:entity/dummy-value
This solution would also address/solve #7051
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp1