Interface ICfnPolicyProps
Properties for defining a CfnPolicy
.
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICfnPolicyProps
Syntax (vb)
Public Interface 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
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. |
Properties
Groups
The name of the group to associate the policy with.
virtual string[] Groups { get; }
Property Value
System.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: _+=,.@-.
PolicyDocument
The policy document.
object PolicyDocument { get; }
Property Value
System.Object
Remarks
You must provide policies in JSON format in IAM. However, for AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS 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:
PolicyName
The name of the policy document.
string PolicyName { get; }
Property Value
System.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: _+=,.@-
Roles
The name of the role to associate the policy with.
virtual string[] Roles { get; }
Property Value
System.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 AWS::IAM::Policy
or AWS::IAM::ManagedPolicy
) has a Ref
to a role and if a resource (such as AWS::ECS::Service
) also has a Ref
to the same role, add a DependsOn
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 AWS::ECS::Service
resource, the DependsOn
attribute ensures that AWS CloudFormation deletes the AWS::ECS::Service
resource before deleting its role's policy.
Users
The name of the user to associate the policy with.
virtual string[] Users { get; }
Property Value
System.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: _+=,.@-