Skip to content
v2.278.0

PolicyProperty Struct ​

Contains information about an attached policy.

An attached policy is a managed policy that has been attached to a user, group, or role.

For more information about managed policies, refer to Managed Policies and Inline Policies in the IAM User Guide .

Example ​

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

declare const policyDocument: any;
const policyProperty: iam.CfnUser.PolicyProperty = {
  policyDocument: policyDocument,
  policyName: 'policyName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam

# policy_document: Any

policy_property = iam.CfnUser.PolicyProperty(
    policy_document=policy_document,
    policy_name="policyName"
)
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.iam.*;

Object policyDocument;

PolicyProperty policyProperty = PolicyProperty.builder()
        .policyDocument(policyDocument)
        .policyName("policyName")
        .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.IAM;

var policyDocument;

var policyProperty = new PolicyProperty {
    PolicyDocument = policyDocument,
    PolicyName = "policyName"
};
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{}

policyProperty := &PolicyProperty{
	PolicyDocument: policyDocument,
	PolicyName: jsii.String("policyName"),
}

Properties ​

policyDocumentanypolicy_documentAnypolicyDocumentObjectPolicyDocumentobjectPolicyDocumentinterface{} required #
The entire contents of the policy that defines permissions.

For more information, see Overview of JSON policies .

policyNamestringpolicy_namestrpolicyNameStringPolicyNamestringPolicyName*string required #
The friendly name (not ARN) identifying the policy.