Skip to content
v2.278.0

CfnPolicyProps Struct ​

Properties for defining a CfnPolicy.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';

declare const policyDocument: any;
const cfnPolicyProps: iot.CfnPolicyProps = {
  policyDocument: policyDocument,

  // the properties below are optional
  policyName: 'policyName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iot as iot

# policy_document: Any

cfn_policy_props = iot.CfnPolicyProps(
    policy_document=policy_document,

    # the properties below are optional
    policy_name="policyName",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iot.*;

Object policyDocument;

CfnPolicyProps cfnPolicyProps = CfnPolicyProps.builder()
        .policyDocument(policyDocument)

        // the properties below are optional
        .policyName("policyName")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoT;

var policyDocument;

var cfnPolicyProps = new CfnPolicyProps {
    PolicyDocument = policyDocument,

    // the properties below are optional
    PolicyName = "policyName",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var policyDocument interface{}

cfnPolicyProps := &CfnPolicyProps{
	PolicyDocument: policyDocument,

	// the properties below are optional
	PolicyName: jsii.String("policyName"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

policyDocumentanypolicy_documentAnypolicyDocumentObjectPolicyDocumentobjectPolicyDocumentinterface{} required #
The JSON document that describes the policy.
policyNameoptionalstringpolicy_nameoptionalstrpolicyNameoptionalStringPolicyNameoptionalstringPolicyNameoptional*string #
The policy name.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #