# CfnResourceShareProps

Properties for defining a `CfnResourceShare`.

Used as props by: [CfnResourceShare](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ram.CfnResourceShare.html)

- Source: Generated at build time
- Type last changed: v2.261.0 · 2 Jul 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ram as ram } from 'aws-cdk-lib';
const cfnResourceShareProps: ram.CfnResourceShareProps = {
  name: 'name',

  // the properties below are optional
  allowExternalPrincipals: false,
  permissionArns: ['permissionArns'],
  principals: ['principals'],
  resourceArns: ['resourceArns'],
  resourceShareConfiguration: {
    exclusiveAccountAccess: false,
    retainSharingOnAccountLeaveOrganization: false,
  },
  sources: ['sources'],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ram as ram

cfn_resource_share_props = ram.CfnResourceShareProps(
    name="name",

    # the properties below are optional
    allow_external_principals=False,
    permission_arns=["permissionArns"],
    principals=["principals"],
    resource_arns=["resourceArns"],
    resource_share_configuration=ram.CfnResourceShare.ResourceShareConfigurationProperty(
        exclusive_account_access=False,
        retain_sharing_on_account_leave_organization=False
    ),
    sources=["sources"],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// 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.*;

CfnResourceShareProps cfnResourceShareProps = CfnResourceShareProps.builder()
        .name("name")

        // the properties below are optional
        .allowExternalPrincipals(false)
        .permissionArns(List.of("permissionArns"))
        .principals(List.of("principals"))
        .resourceArns(List.of("resourceArns"))
        .resourceShareConfiguration(ResourceShareConfigurationProperty.builder()
                .exclusiveAccountAccess(false)
                .retainSharingOnAccountLeaveOrganization(false)
                .build())
        .sources(List.of("sources"))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.RAM;

var cfnResourceShareProps = new CfnResourceShareProps {
    Name = "name",

    // the properties below are optional
    AllowExternalPrincipals = false,
    PermissionArns = new [] { "permissionArns" },
    Principals = new [] { "principals" },
    ResourceArns = new [] { "resourceArns" },
    ResourceShareConfiguration = new ResourceShareConfigurationProperty {
        ExclusiveAccountAccess = false,
        RetainSharingOnAccountLeaveOrganization = false
    },
    Sources = new [] { "sources" },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnResourceShareProps := &CfnResourceShareProps{
	Name: jsii.String("name"),

	// the properties below are optional
	AllowExternalPrincipals: jsii.Boolean(false),
	PermissionArns: []*string{
		jsii.String("permissionArns"),
	},
	Principals: []*string{
		jsii.String("principals"),
	},
	ResourceArns: []*string{
		jsii.String("resourceArns"),
	},
	ResourceShareConfiguration: &ResourceShareConfigurationProperty{
		ExclusiveAccountAccess: jsii.Boolean(false),
		RetainSharingOnAccountLeaveOrganization: jsii.Boolean(false),
	},
	Sources: []*string{
		jsii.String("sources"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `allowExternalPrincipals`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — 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` .

- `name`: string (required) — Specifies the name of the resource share.

- `permissionArns`: string[] — Specifies the [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com//general/latest/gr/aws-arns-and-namespaces.html) 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.

- `principals`: string[] — 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](https://docs.aws.amazon.com/ram/latest/userguide/shareable.html) in the *AWS Resource Access Manager User Guide* .

- `resourceArns`: string[] — Specifies a list of one or more ARNs of the resources to associate with the resource share.

- `resourceShareConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnResourceShare.ResourceShareConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ram.CfnResourceShare.ResourceShareConfigurationProperty.html) — The configuration for a resource share.

- `sources`: string[] — Specifies from which source accounts the service principal has access to the resources in this resource share.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — 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.
