Skip to content

Commit

Permalink
Issue #3 WIP SecretValue
Browse files Browse the repository at this point in the history
Former-commit-id: 1154991
  • Loading branch information
cschneider-vertical-relevance committed Apr 29, 2022
1 parent 9bd61e2 commit de422b2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions stacks/control_broker_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Stack,
RemovalPolicy,
CfnOutput,
SecretValue,
aws_config,
aws_dynamodb,
aws_s3,
Expand Down Expand Up @@ -180,7 +181,21 @@ def deploy_utils(self):
"Condition": {
"ForAnyValue:StringLike": {
"aws:PrincipalOrgPaths": [

# A - works. requires local export of env var

f'{os.environ.get("AWS_ORG_ID")}/*',

# B - not working

# does not resolve. Policy in console reads:<aws_cdk.SecretValue object at 0x7fa1d1ac7fd0>/
f'{SecretValue.ssm_secure(parameter_name="/control-broker/aws-organization-id",version="1")}/*',

# do not deploy
f'{SecretValue.ssm_secure(parameter_name="/control-broker/aws-organization-id",version="1").resolve()}/*',
f'{SecretValue.ssm_secure(parameter_name="/control-broker/aws-organization-id",version="1").unsafe_unwrap()}/*',
f'{SecretValue.ssm_secure(parameter_name="/control-broker/aws-organization-id",version="1").to_string()}/*',

]
}
}
Expand Down

0 comments on commit de422b2

Please sign in to comment.