Class CfnResourceShare

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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:23.158Z") @Stability(Stable) public class CfnResourceShare extends CfnResource implements IInspectable, ITaggable
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"))
         .sources(List.of("sources"))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnResourceShareProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • 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.
    • 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.
    • 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.
    • 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:.

    • setPrincipals

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

      The possible values are:.

    • 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.
    • getSources

      @Stability(Stable) @Nullable public List<String> getSources()
    • setSources

      @Stability(Stable) public void setSources(@Nullable List<String> value)
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Specifies one or more tags to attach to the resource share itself.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Specifies one or more tags to attach to the resource share itself.