# OriginBindOptions

Options passed to Origin.bind().

Used as argument in: [IOrigin.bind](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.IOrigin.html#bind)

- Source: [`aws-cloudfront/lib/origin.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudfront/lib/origin.ts#L184)
- Type last changed: v2.156.0 · 6 Sep 2024

## 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 originBindOptions: cloudfront.OriginBindOptions = {
  originId: 'originId',

  // the properties below are optional
  distributionId: 'distributionId',
};
```

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

origin_bind_options = cloudfront.OriginBindOptions(
    origin_id="originId",

    # the properties below are optional
    distribution_id="distributionId"
)
```

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

OriginBindOptions originBindOptions = OriginBindOptions.builder()
        .originId("originId")

        // the properties below are optional
        .distributionId("distributionId")
        .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 originBindOptions = new OriginBindOptions {
    OriginId = "originId",

    // the properties below are optional
    DistributionId = "distributionId"
};
```

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"

originBindOptions := &OriginBindOptions{
	OriginId: jsii.String("originId"),

	// the properties below are optional
	DistributionId: jsii.String("distributionId"),
}
```

## Properties

- `distributionId`: string — The identifier of the Distribution this Origin is used for.

  **Default:** no distribution id

  This is used to grant origin access permissions to the distribution for origin access control.

- `originId`: string (required) — The identifier of this Origin, as assigned by the Distribution this Origin has been used added to.
