aws-cdk-lib.CfnJsonProps

interface CfnJsonProps

LanguageType name
.NETAmazon.CDK.CfnJsonProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2#CfnJsonProps
Javasoftware.amazon.awscdk.CfnJsonProps
Pythonaws_cdk.CfnJsonProps
TypeScript (source)aws-cdk-lib » CfnJsonProps

Example

const tagParam = new CfnParameter(this, 'TagName');

const stringEquals = new CfnJson(this, 'ConditionJson', {
  value: {
    [`aws:PrincipalTag/${tagParam.valueAsString}`]: true,
  },
});

const principal = new iam.AccountRootPrincipal().withConditions({
  StringEquals: stringEquals,
});

new iam.Role(this, 'MyRole', { assumedBy: principal });

Properties

NameTypeDescription
valueanyThe value to resolve.

value

Type: any

The value to resolve.

Can be any JavaScript object, including tokens and references in keys or values.