# S3OriginProperty

A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const s3OriginProperty: cloudfront.CfnStreamingDistribution.S3OriginProperty = {
  domainName: 'domainName',
  originAccessIdentity: 'originAccessIdentity',
};
```

Python:

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

s3_origin_property = cloudfront.CfnStreamingDistribution.S3OriginProperty(
    domain_name="domainName",
    origin_access_identity="originAccessIdentity"
)
```

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.cloudfront.*;

S3OriginProperty s3OriginProperty = S3OriginProperty.builder()
        .domainName("domainName")
        .originAccessIdentity("originAccessIdentity")
        .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.CloudFront;

var s3OriginProperty = new S3OriginProperty {
    DomainName = "domainName",
    OriginAccessIdentity = "originAccessIdentity"
};
```

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"

s3OriginProperty := &S3OriginProperty{
	DomainName: jsii.String("domainName"),
	OriginAccessIdentity: jsii.String("originAccessIdentity"),
}
```

## Properties

- `domainName`: string (required) — The DNS name of the Amazon S3 origin.

- `originAccessIdentity`: string (required) — The CloudFront origin access identity to associate with the distribution.

  Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront.

  If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

  To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

  To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

  For more information, see [Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) in the *Amazon CloudFront Developer Guide* .
