Class CfnPermission

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:34.889Z") @Stability(Stable) public class CfnPermission extends CfnResource implements IInspectable
A CloudFormation AWS::RAM::Permission.

Creates a customer managed permission for a specified resource type that you can attach to resource shares. It is created in the AWS Region in which you call the operation.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ram.*;
 Object policyTemplate;
 CfnPermission cfnPermission = CfnPermission.Builder.create(this, "MyCfnPermission")
         .name("name")
         .policyTemplate(policyTemplate)
         .resourceType("resourceType")
         // the properties below are optional
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnPermission

      protected CfnPermission(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnPermission

      protected CfnPermission(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnPermission

      @Stability(Stable) public CfnPermission(@NotNull Construct scope, @NotNull String id, @NotNull CfnPermissionProps props)
      Create a new AWS::RAM::Permission.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the new permission.
    • getAttrIsResourceTypeDefault

      @Stability(Stable) @NotNull public IResolvable getAttrIsResourceTypeDefault()
      Specifies whether this permission is the default for new resource shares that include resources of the associated resource type.
    • getAttrPermissionType

      @Stability(Stable) @NotNull public String getAttrPermissionType()
      The type of managed permission. This can be one of the following values:.

      • AWS_MANAGED_PERMISSION – AWS created and manages this managed permission. You can associate it with your resource shares, but you can't modify it.
      • CUSTOMER_MANAGED_PERMISSION – You, or another principal in your account created this managed permission. You can associate it with your resource shares and create new versions that have different permissions.
    • getAttrVersion

      @Stability(Stable) @NotNull public String getAttrVersion()
      The version number for this version of the permission.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Specifies a list of one or more tag key and value pairs to attach to the permission.
    • getName

      @Stability(Stable) @NotNull public String getName()
      Specifies the name of the customer managed permission.

      The name must be unique within the AWS Region .

    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      Specifies the name of the customer managed permission.

      The name must be unique within the AWS Region .

    • getPolicyTemplate

      @Stability(Stable) @NotNull public Object getPolicyTemplate()
      A string in JSON format string that contains the following elements of a resource-based policy:.

      • Effect : must be set to ALLOW .
      • Action : specifies the actions that are allowed by this customer managed permission. The list must contain only actions that are supported by the specified resource type. For a list of all actions supported by each resource type, see Actions, resources, and condition keys for AWS services in the AWS Identity and Access Management User Guide .
      • Condition : (optional) specifies conditional parameters that must evaluate to true when a user attempts an action for that action to be allowed. For more information about the Condition element, see IAM policies: Condition element in the AWS Identity and Access Management User Guide .

      This template can't include either the Resource or Principal elements. Those are both filled in by AWS RAM when it instantiates the resource-based policy on each resource shared using this managed permission. The Resource comes from the ARN of the specific resource that you are sharing. The Principal comes from the list of identities added to the resource share.

    • setPolicyTemplate

      @Stability(Stable) public void setPolicyTemplate(@NotNull Object value)
      A string in JSON format string that contains the following elements of a resource-based policy:.

      • Effect : must be set to ALLOW .
      • Action : specifies the actions that are allowed by this customer managed permission. The list must contain only actions that are supported by the specified resource type. For a list of all actions supported by each resource type, see Actions, resources, and condition keys for AWS services in the AWS Identity and Access Management User Guide .
      • Condition : (optional) specifies conditional parameters that must evaluate to true when a user attempts an action for that action to be allowed. For more information about the Condition element, see IAM policies: Condition element in the AWS Identity and Access Management User Guide .

      This template can't include either the Resource or Principal elements. Those are both filled in by AWS RAM when it instantiates the resource-based policy on each resource shared using this managed permission. The Resource comes from the ARN of the specific resource that you are sharing. The Principal comes from the list of identities added to the resource share.

    • getResourceType

      @Stability(Stable) @NotNull public String getResourceType()
      Specifies the name of the resource type that this customer managed permission applies to.

      The format is *<service-code>* : *<resource-type>* and is not case sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string ec2:subnet . To see the list of valid values for this parameter, query the ListResourceTypes operation.

    • setResourceType

      @Stability(Stable) public void setResourceType(@NotNull String value)
      Specifies the name of the resource type that this customer managed permission applies to.

      The format is *<service-code>* : *<resource-type>* and is not case sensitive. For example, to specify an Amazon EC2 Subnet, you can use the string ec2:subnet . To see the list of valid values for this parameter, query the ListResourceTypes operation.