Show / Hide Table of Contents

Class CfnPolicyProps

Properties for defining a CfnPolicy.

Inheritance
object
CfnPolicyProps
Implements
ICfnPolicyProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnPolicyProps : ICfnPolicyProps
Syntax (vb)
Public Class CfnPolicyProps Implements ICfnPolicyProps
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html

ExampleMetadata: fixture=_generated

Examples
// 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 cfnPolicyProps = new CfnPolicyProps {
                 PolicyDocument = policyDocument,
                 PolicyName = "policyName",

                 // the properties below are optional
                 Groups = new [] { "groups" },
                 Roles = new [] { "roles" },
                 Users = new [] { "users" }
             };

Synopsis

Constructors

CfnPolicyProps()

Properties for defining a CfnPolicy.

Properties

Groups

The name of the group to associate the policy with.

PolicyDocument

The policy document.

PolicyName

The name of the policy document.

Roles

The name of the role to associate the policy with.

Users

The name of the user to associate the policy with.

Constructors

CfnPolicyProps()

Properties for defining a CfnPolicy.

public CfnPolicyProps()
Remarks

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html

ExampleMetadata: fixture=_generated

Examples
// 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 cfnPolicyProps = new CfnPolicyProps {
                 PolicyDocument = policyDocument,
                 PolicyName = "policyName",

                 // the properties below are optional
                 Groups = new [] { "groups" },
                 Roles = new [] { "roles" },
                 Users = new [] { "users" }
             };

Properties

Groups

The name of the group to associate the policy with.

public string[]? Groups { get; set; }
Property Value

string[]

Remarks

This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-.

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html#cfn-iam-policy-groups

PolicyDocument

The policy document.

public object PolicyDocument { get; set; }
Property Value

object

Remarks

You must provide policies in JSON format in IAM. However, for CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.

The regex pattern used to validate this parameter is a string of characters consisting of the following:

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html#cfn-iam-policy-policydocument

    PolicyName

    The name of the policy document.

    public string PolicyName { get; set; }
    Property Value

    string

    Remarks

    This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html#cfn-iam-policy-policyname

    Roles

    The name of the role to associate the policy with.

    public string[]? Roles { get; set; }
    Property Value

    string[]

    Remarks

    This parameter allows (per its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    If an external policy (such as <code>AWS::IAM::Policy</code> or <code>AWS::IAM::ManagedPolicy</code> ) has a <code>Ref</code> to a role and if a resource (such as <code>AWS::ECS::Service</code> ) also has a <code>Ref</code> to the same role, add a <code>DependsOn</code> attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role's policy is available throughout the resource's lifecycle. For example, when you delete a stack with an <code>AWS::ECS::Service</code> resource, the <code>DependsOn</code> attribute ensures that CloudFormation deletes the <code>AWS::ECS::Service</code> resource before deleting its role's policy.
    

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html#cfn-iam-policy-roles

    Users

    The name of the user to associate the policy with.

    public string[]? Users { get; set; }
    Property Value

    string[]

    Remarks

    This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html#cfn-iam-policy-users

    Implements

    ICfnPolicyProps
    Back to top Generated by DocFX