# RestrictionsProperty

A complex type that identifies ways in which you want to restrict distribution of your content.

- 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 restrictionsProperty: cloudfront.CfnDistribution.RestrictionsProperty = {
  geoRestriction: {
    restrictionType: 'restrictionType',

    // the properties below are optional
    locations: ['locations'],
  },
};
```

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

restrictions_property = cloudfront.CfnDistribution.RestrictionsProperty(
    geo_restriction=cloudfront.CfnDistribution.GeoRestrictionProperty(
        restriction_type="restrictionType",

        # the properties below are optional
        locations=["locations"]
    )
)
```

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

RestrictionsProperty restrictionsProperty = RestrictionsProperty.builder()
        .geoRestriction(GeoRestrictionProperty.builder()
                .restrictionType("restrictionType")

                // the properties below are optional
                .locations(List.of("locations"))
                .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.CloudFront;

var restrictionsProperty = new RestrictionsProperty {
    GeoRestriction = new GeoRestrictionProperty {
        RestrictionType = "restrictionType",

        // the properties below are optional
        Locations = new [] { "locations" }
    }
};
```

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"

restrictionsProperty := &RestrictionsProperty{
	GeoRestriction: &GeoRestrictionProperty{
		RestrictionType: jsii.String("restrictionType"),

		// the properties below are optional
		Locations: []*string{
			jsii.String("locations"),
		},
	},
}
```

## Properties

- `geoRestriction`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnDistribution.GeoRestrictionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CfnDistribution.GeoRestrictionProperty.html) (required) — A complex type that controls the countries in which your content is distributed.

  CloudFront determines the location of your users using `MaxMind` GeoIP databases. To disable geo restriction, remove the [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) property from your stack template.
