Class CfnResourceShare

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.892Z") @Stability(Stable) public class CfnResourceShare extends CfnResource implements IInspectable
A CloudFormation AWS::RAM::ResourceShare.

Creates a resource share. You can provide a list of the Amazon Resource Names (ARNs) for the resources that you want to share, a list of principals you want to share the resources with, and the permissions to grant those principals.

Sharing a resource makes it available for use by principals outside of the AWS account that created the resource. Sharing doesn't change any permissions or quotas that apply to the resource in the account that created it.

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.*;
 CfnResourceShare cfnResourceShare = CfnResourceShare.Builder.create(this, "MyCfnResourceShare")
         .name("name")
         // the properties below are optional
         .allowExternalPrincipals(false)
         .permissionArns(List.of("permissionArns"))
         .principals(List.of("principals"))
         .resourceArns(List.of("resourceArns"))
         .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

    • CfnResourceShare

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

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

      @Stability(Stable) public CfnResourceShare(@NotNull Construct scope, @NotNull String id, @NotNull CfnResourceShareProps props)
      Create a new AWS::RAM::ResourceShare.

      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 resource share.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Specifies one or more tags to attach to the resource share itself.

      It doesn't attach the tags to the resources associated with the resource share.

    • getName

      @Stability(Stable) @NotNull public String getName()
      Specifies the name of the resource share.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      Specifies the name of the resource share.
    • getAllowExternalPrincipals

      @Stability(Stable) @Nullable public Object getAllowExternalPrincipals()
      Specifies whether principals outside your organization in AWS Organizations can be associated with a resource share.

      A value of true lets you share with individual AWS accounts that are not in your organization. A value of false only has meaning if your account is a member of an AWS Organization. The default value is true .

    • setAllowExternalPrincipals

      @Stability(Stable) public void setAllowExternalPrincipals(@Nullable Boolean value)
      Specifies whether principals outside your organization in AWS Organizations can be associated with a resource share.

      A value of true lets you share with individual AWS accounts that are not in your organization. A value of false only has meaning if your account is a member of an AWS Organization. The default value is true .

    • setAllowExternalPrincipals

      @Stability(Stable) public void setAllowExternalPrincipals(@Nullable IResolvable value)
      Specifies whether principals outside your organization in AWS Organizations can be associated with a resource share.

      A value of true lets you share with individual AWS accounts that are not in your organization. A value of false only has meaning if your account is a member of an AWS Organization. The default value is true .

    • getPermissionArns

      @Stability(Stable) @Nullable public List<String> getPermissionArns()
      Specifies the Amazon Resource Names (ARNs) of the AWS RAM permission to associate with the resource share. If you do not specify an ARN for the permission, AWS RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
    • setPermissionArns

      @Stability(Stable) public void setPermissionArns(@Nullable List<String> value)
      Specifies the Amazon Resource Names (ARNs) of the AWS RAM permission to associate with the resource share. If you do not specify an ARN for the permission, AWS RAM automatically attaches the default version of the permission for each resource type. You can associate only one permission with each resource type included in the resource share.
    • getPrincipals

      @Stability(Stable) @Nullable public List<String> getPrincipals()
      Specifies the principals to associate with the resource share. The possible values are:.

      • An AWS account ID
      • An Amazon Resource Name (ARN) of an organization in AWS Organizations
      • An ARN of an organizational unit (OU) in AWS Organizations
      • An ARN of an IAM role
      • An ARN of an IAM user

      Not all resource types can be shared with IAM roles and users. For more information, see the column Can share with IAM roles and users in the tables on Shareable AWS resources in the AWS Resource Access Manager User Guide .

    • setPrincipals

      @Stability(Stable) public void setPrincipals(@Nullable List<String> value)
      Specifies the principals to associate with the resource share. The possible values are:.

      • An AWS account ID
      • An Amazon Resource Name (ARN) of an organization in AWS Organizations
      • An ARN of an organizational unit (OU) in AWS Organizations
      • An ARN of an IAM role
      • An ARN of an IAM user

      Not all resource types can be shared with IAM roles and users. For more information, see the column Can share with IAM roles and users in the tables on Shareable AWS resources in the AWS Resource Access Manager User Guide .

    • getResourceArns

      @Stability(Stable) @Nullable public List<String> getResourceArns()
      Specifies a list of one or more ARNs of the resources to associate with the resource share.
    • setResourceArns

      @Stability(Stable) public void setResourceArns(@Nullable List<String> value)
      Specifies a list of one or more ARNs of the resources to associate with the resource share.