Skip to content

Instantly share code, notes, and snippets.

@skinny85
Created May 14, 2020 03:02
Show Gist options
  • Save skinny85/e502ada2c22bf55a329038149da2d257 to your computer and use it in GitHub Desktop.
Save skinny85/e502ada2c22bf55a329038149da2d257 to your computer and use it in GitHub Desktop.
s3.generated.ts with the changes from https://github.com/aws/aws-cdk/pull/7971
// Copyright 2012-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Generated from the AWS CloudFormation Resource Specification
// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2020-05-14T02:15:02.155Z","fingerprint":"vIDbAYnP8upszOpBsI8OfKvGsCcZbaj6TbBHeG5hKeg="}
// tslint:disable:max-line-length | This is generated code - line lengths are difficult to control
import * as cdk from '@aws-cdk/core';
import * as cfn_parse from '@aws-cdk/core/lib/cfn-parse';
/**
* Properties for defining a `AWS::S3::AccessPoint`
*
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html
*/
export interface CfnAccessPointProps {
/**
* `AWS::S3::AccessPoint.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-bucket
*/
readonly bucket: string;
/**
* `AWS::S3::AccessPoint.CreationDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-creationdate
*/
readonly creationDate?: string;
/**
* `AWS::S3::AccessPoint.Name`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-name
*/
readonly name?: string;
/**
* `AWS::S3::AccessPoint.NetworkOrigin`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-networkorigin
*/
readonly networkOrigin?: string;
/**
* `AWS::S3::AccessPoint.Policy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-policy
*/
readonly policy?: any | cdk.IResolvable;
/**
* `AWS::S3::AccessPoint.PolicyStatus`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-policystatus
*/
readonly policyStatus?: any | cdk.IResolvable;
/**
* `AWS::S3::AccessPoint.PublicAccessBlockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-publicaccessblockconfiguration
*/
readonly publicAccessBlockConfiguration?: CfnAccessPoint.PublicAccessBlockConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::AccessPoint.VpcConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-vpcconfiguration
*/
readonly vpcConfiguration?: CfnAccessPoint.VpcConfigurationProperty | cdk.IResolvable;
}
/**
* Determine whether the given properties match those of a `CfnAccessPointProps`
*
* @param properties - the TypeScript properties of a `CfnAccessPointProps`
*
* @returns the result of the validation.
*/
function CfnAccessPointPropsValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
errors.collect(cdk.propertyValidator('creationDate', cdk.validateString)(properties.creationDate));
errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));
errors.collect(cdk.propertyValidator('networkOrigin', cdk.validateString)(properties.networkOrigin));
errors.collect(cdk.propertyValidator('policy', cdk.validateObject)(properties.policy));
errors.collect(cdk.propertyValidator('policyStatus', cdk.validateObject)(properties.policyStatus));
errors.collect(cdk.propertyValidator('publicAccessBlockConfiguration', CfnAccessPoint_PublicAccessBlockConfigurationPropertyValidator)(properties.publicAccessBlockConfiguration));
errors.collect(cdk.propertyValidator('vpcConfiguration', CfnAccessPoint_VpcConfigurationPropertyValidator)(properties.vpcConfiguration));
return errors.wrap('supplied properties not correct for "CfnAccessPointProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::AccessPoint` resource
*
* @param properties - the TypeScript properties of a `CfnAccessPointProps`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::AccessPoint` resource.
*/
// @ts-ignore TS6133
function cfnAccessPointPropsToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnAccessPointPropsValidator(properties).assertSuccess();
return {
Bucket: cdk.stringToCloudFormation(properties.bucket),
CreationDate: cdk.stringToCloudFormation(properties.creationDate),
Name: cdk.stringToCloudFormation(properties.name),
NetworkOrigin: cdk.stringToCloudFormation(properties.networkOrigin),
Policy: cdk.objectToCloudFormation(properties.policy),
PolicyStatus: cdk.objectToCloudFormation(properties.policyStatus),
PublicAccessBlockConfiguration: cfnAccessPointPublicAccessBlockConfigurationPropertyToCloudFormation(properties.publicAccessBlockConfiguration),
VpcConfiguration: cfnAccessPointVpcConfigurationPropertyToCloudFormation(properties.vpcConfiguration),
};
}
// @ts-ignore TS6133
function CfnAccessPointPropsFromCloudFormation(properties: any): CfnAccessPointProps {
properties = properties || {};
return {
bucket: cfn_parse.FromCloudFormation.getString(properties.Bucket),
creationDate: properties.CreationDate == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.CreationDate),
name: properties.Name == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Name),
networkOrigin: properties.NetworkOrigin == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.NetworkOrigin),
policy: properties.Policy == null ? undefined : cfn_parse.FromCloudFormation.getAny(properties.Policy),
policyStatus: properties.PolicyStatus == null ? undefined : cfn_parse.FromCloudFormation.getAny(properties.PolicyStatus),
publicAccessBlockConfiguration: properties.PublicAccessBlockConfiguration == null ? undefined : CfnAccessPointPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration),
vpcConfiguration: properties.VpcConfiguration == null ? undefined : CfnAccessPointVpcConfigurationPropertyFromCloudFormation(properties.VpcConfiguration),
};
}
/**
* A CloudFormation `AWS::S3::AccessPoint`
*
* @cloudformationResource AWS::S3::AccessPoint
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html
*/
export class CfnAccessPoint extends cdk.CfnResource implements cdk.IInspectable {
/**
* The CloudFormation resource type name for this resource class.
*/
public static readonly CFN_RESOURCE_TYPE_NAME = "AWS::S3::AccessPoint";
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @experimental
*/
public static fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, finder: cdk.ICfnFinder): CfnAccessPoint {
resourceAttributes = resourceAttributes || {};
const resourceProperties = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Properties);
const props = CfnAccessPointPropsFromCloudFormation(resourceProperties);
const ret = new CfnAccessPoint(scope, id, props);
const cfnOptions = ret.cfnOptions;
cfnOptions.deletionPolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.DeletionPolicy);
cfnOptions.updateReplacePolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.UpdateReplacePolicy);
cfnOptions.metadata = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Metadata);
// handle DependsOn
resourceAttributes.DependsOn = resourceAttributes.DependsOn ?? [];
const dependencies: string[] = Array.isArray(resourceAttributes.DependsOn) ? resourceAttributes.DependsOn : [resourceAttributes.DependsOn];
for (const dep of dependencies) {
const depResource = finder.findResource(dep);
if (!depResource) {
throw new Error(`Resource '${id}' depends on '${dep}' that doesn't exist`);
}
ret.node.addDependency(depResource);
}
return ret;
}
/**
* `AWS::S3::AccessPoint.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-bucket
*/
public bucket: string;
/**
* `AWS::S3::AccessPoint.CreationDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-creationdate
*/
public creationDate: string | undefined;
/**
* `AWS::S3::AccessPoint.Name`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-name
*/
public name: string | undefined;
/**
* `AWS::S3::AccessPoint.NetworkOrigin`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-networkorigin
*/
public networkOrigin: string | undefined;
/**
* `AWS::S3::AccessPoint.Policy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-policy
*/
public policy: any | cdk.IResolvable | undefined;
/**
* `AWS::S3::AccessPoint.PolicyStatus`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-policystatus
*/
public policyStatus: any | cdk.IResolvable | undefined;
/**
* `AWS::S3::AccessPoint.PublicAccessBlockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-publicaccessblockconfiguration
*/
public publicAccessBlockConfiguration: CfnAccessPoint.PublicAccessBlockConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::AccessPoint.VpcConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accesspoint.html#cfn-s3-accesspoint-vpcconfiguration
*/
public vpcConfiguration: CfnAccessPoint.VpcConfigurationProperty | cdk.IResolvable | undefined;
/**
* Create a new `AWS::S3::AccessPoint`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope: cdk.Construct, id: string, props: CfnAccessPointProps) {
super(scope, id, { type: CfnAccessPoint.CFN_RESOURCE_TYPE_NAME, properties: props });
cdk.requireProperty(props, 'bucket', this);
this.bucket = props.bucket;
this.creationDate = props.creationDate;
this.name = props.name;
this.networkOrigin = props.networkOrigin;
this.policy = props.policy;
this.policyStatus = props.policyStatus;
this.publicAccessBlockConfiguration = props.publicAccessBlockConfiguration;
this.vpcConfiguration = props.vpcConfiguration;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
* @stability experimental
*/
public inspect(inspector: cdk.TreeInspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnAccessPoint.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
protected get cfnProperties(): { [key: string]: any } {
return {
bucket: this.bucket,
creationDate: this.creationDate,
name: this.name,
networkOrigin: this.networkOrigin,
policy: this.policy,
policyStatus: this.policyStatus,
publicAccessBlockConfiguration: this.publicAccessBlockConfiguration,
vpcConfiguration: this.vpcConfiguration,
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnAccessPointPropsToCloudFormation(props);
}
}
export namespace CfnAccessPoint {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html
*/
export interface PublicAccessBlockConfigurationProperty {
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.BlockPublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-blockpublicacls
*/
readonly blockPublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.BlockPublicPolicy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-blockpublicpolicy
*/
readonly blockPublicPolicy?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.IgnorePublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-ignorepublicacls
*/
readonly ignorePublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.RestrictPublicBuckets`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-restrictpublicbuckets
*/
readonly restrictPublicBuckets?: boolean | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PublicAccessBlockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnAccessPoint_PublicAccessBlockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('blockPublicAcls', cdk.validateBoolean)(properties.blockPublicAcls));
errors.collect(cdk.propertyValidator('blockPublicPolicy', cdk.validateBoolean)(properties.blockPublicPolicy));
errors.collect(cdk.propertyValidator('ignorePublicAcls', cdk.validateBoolean)(properties.ignorePublicAcls));
errors.collect(cdk.propertyValidator('restrictPublicBuckets', cdk.validateBoolean)(properties.restrictPublicBuckets));
return errors.wrap('supplied properties not correct for "PublicAccessBlockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::AccessPoint.PublicAccessBlockConfiguration` resource
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::AccessPoint.PublicAccessBlockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnAccessPointPublicAccessBlockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnAccessPoint_PublicAccessBlockConfigurationPropertyValidator(properties).assertSuccess();
return {
BlockPublicAcls: cdk.booleanToCloudFormation(properties.blockPublicAcls),
BlockPublicPolicy: cdk.booleanToCloudFormation(properties.blockPublicPolicy),
IgnorePublicAcls: cdk.booleanToCloudFormation(properties.ignorePublicAcls),
RestrictPublicBuckets: cdk.booleanToCloudFormation(properties.restrictPublicBuckets),
};
}
// @ts-ignore TS6133
function CfnAccessPointPublicAccessBlockConfigurationPropertyFromCloudFormation(properties: any): CfnAccessPoint.PublicAccessBlockConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
blockPublicAcls: properties.BlockPublicAcls == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls),
blockPublicPolicy: properties.BlockPublicPolicy == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy),
ignorePublicAcls: properties.IgnorePublicAcls == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls),
restrictPublicBuckets: properties.RestrictPublicBuckets == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets),
};
}
export namespace CfnAccessPoint {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-vpcconfiguration.html
*/
export interface VpcConfigurationProperty {
/**
* `CfnAccessPoint.VpcConfigurationProperty.VpcId`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-vpcconfiguration.html#cfn-s3-accesspoint-vpcconfiguration-vpcid
*/
readonly vpcId?: string;
}
}
/**
* Determine whether the given properties match those of a `VpcConfigurationProperty`
*
* @param properties - the TypeScript properties of a `VpcConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnAccessPoint_VpcConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('vpcId', cdk.validateString)(properties.vpcId));
return errors.wrap('supplied properties not correct for "VpcConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::AccessPoint.VpcConfiguration` resource
*
* @param properties - the TypeScript properties of a `VpcConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::AccessPoint.VpcConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnAccessPointVpcConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnAccessPoint_VpcConfigurationPropertyValidator(properties).assertSuccess();
return {
VpcId: cdk.stringToCloudFormation(properties.vpcId),
};
}
// @ts-ignore TS6133
function CfnAccessPointVpcConfigurationPropertyFromCloudFormation(properties: any): CfnAccessPoint.VpcConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
vpcId: properties.VpcId == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.VpcId),
};
}
/**
* Properties for defining a `AWS::S3::Bucket`
*
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html
*/
export interface CfnBucketProps {
/**
* `AWS::S3::Bucket.AccelerateConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accelerateconfiguration
*/
readonly accelerateConfiguration?: CfnBucket.AccelerateConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.AccessControl`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accesscontrol
*/
readonly accessControl?: string;
/**
* `AWS::S3::Bucket.AnalyticsConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-analyticsconfigurations
*/
readonly analyticsConfigurations?: Array<CfnBucket.AnalyticsConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `AWS::S3::Bucket.BucketEncryption`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-bucketencryption
*/
readonly bucketEncryption?: CfnBucket.BucketEncryptionProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.BucketName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name
*/
readonly bucketName?: string;
/**
* `AWS::S3::Bucket.CorsConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-crossoriginconfig
*/
readonly corsConfiguration?: CfnBucket.CorsConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.InventoryConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-inventoryconfigurations
*/
readonly inventoryConfigurations?: Array<CfnBucket.InventoryConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `AWS::S3::Bucket.LifecycleConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-lifecycleconfig
*/
readonly lifecycleConfiguration?: CfnBucket.LifecycleConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.LoggingConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-loggingconfig
*/
readonly loggingConfiguration?: CfnBucket.LoggingConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.MetricsConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-metricsconfigurations
*/
readonly metricsConfigurations?: Array<CfnBucket.MetricsConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `AWS::S3::Bucket.NotificationConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-notification
*/
readonly notificationConfiguration?: CfnBucket.NotificationConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.ObjectLockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockconfiguration
*/
readonly objectLockConfiguration?: CfnBucket.ObjectLockConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.ObjectLockEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockenabled
*/
readonly objectLockEnabled?: boolean | cdk.IResolvable;
/**
* `AWS::S3::Bucket.PublicAccessBlockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-publicaccessblockconfiguration
*/
readonly publicAccessBlockConfiguration?: CfnBucket.PublicAccessBlockConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.ReplicationConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-replicationconfiguration
*/
readonly replicationConfiguration?: CfnBucket.ReplicationConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.Tags`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-tags
*/
readonly tags?: cdk.CfnTag[];
/**
* `AWS::S3::Bucket.VersioningConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-versioning
*/
readonly versioningConfiguration?: CfnBucket.VersioningConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::Bucket.WebsiteConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-websiteconfiguration
*/
readonly websiteConfiguration?: CfnBucket.WebsiteConfigurationProperty | cdk.IResolvable;
}
/**
* Determine whether the given properties match those of a `CfnBucketProps`
*
* @param properties - the TypeScript properties of a `CfnBucketProps`
*
* @returns the result of the validation.
*/
function CfnBucketPropsValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accelerateConfiguration', CfnBucket_AccelerateConfigurationPropertyValidator)(properties.accelerateConfiguration));
errors.collect(cdk.propertyValidator('accessControl', cdk.validateString)(properties.accessControl));
errors.collect(cdk.propertyValidator('analyticsConfigurations', cdk.listValidator(CfnBucket_AnalyticsConfigurationPropertyValidator))(properties.analyticsConfigurations));
errors.collect(cdk.propertyValidator('bucketEncryption', CfnBucket_BucketEncryptionPropertyValidator)(properties.bucketEncryption));
errors.collect(cdk.propertyValidator('bucketName', cdk.validateString)(properties.bucketName));
errors.collect(cdk.propertyValidator('corsConfiguration', CfnBucket_CorsConfigurationPropertyValidator)(properties.corsConfiguration));
errors.collect(cdk.propertyValidator('inventoryConfigurations', cdk.listValidator(CfnBucket_InventoryConfigurationPropertyValidator))(properties.inventoryConfigurations));
errors.collect(cdk.propertyValidator('lifecycleConfiguration', CfnBucket_LifecycleConfigurationPropertyValidator)(properties.lifecycleConfiguration));
errors.collect(cdk.propertyValidator('loggingConfiguration', CfnBucket_LoggingConfigurationPropertyValidator)(properties.loggingConfiguration));
errors.collect(cdk.propertyValidator('metricsConfigurations', cdk.listValidator(CfnBucket_MetricsConfigurationPropertyValidator))(properties.metricsConfigurations));
errors.collect(cdk.propertyValidator('notificationConfiguration', CfnBucket_NotificationConfigurationPropertyValidator)(properties.notificationConfiguration));
errors.collect(cdk.propertyValidator('objectLockConfiguration', CfnBucket_ObjectLockConfigurationPropertyValidator)(properties.objectLockConfiguration));
errors.collect(cdk.propertyValidator('objectLockEnabled', cdk.validateBoolean)(properties.objectLockEnabled));
errors.collect(cdk.propertyValidator('publicAccessBlockConfiguration', CfnBucket_PublicAccessBlockConfigurationPropertyValidator)(properties.publicAccessBlockConfiguration));
errors.collect(cdk.propertyValidator('replicationConfiguration', CfnBucket_ReplicationConfigurationPropertyValidator)(properties.replicationConfiguration));
errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags));
errors.collect(cdk.propertyValidator('versioningConfiguration', CfnBucket_VersioningConfigurationPropertyValidator)(properties.versioningConfiguration));
errors.collect(cdk.propertyValidator('websiteConfiguration', CfnBucket_WebsiteConfigurationPropertyValidator)(properties.websiteConfiguration));
return errors.wrap('supplied properties not correct for "CfnBucketProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket` resource
*
* @param properties - the TypeScript properties of a `CfnBucketProps`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket` resource.
*/
// @ts-ignore TS6133
function cfnBucketPropsToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucketPropsValidator(properties).assertSuccess();
return {
AccelerateConfiguration: cfnBucketAccelerateConfigurationPropertyToCloudFormation(properties.accelerateConfiguration),
AccessControl: cdk.stringToCloudFormation(properties.accessControl),
AnalyticsConfigurations: cdk.listMapper(cfnBucketAnalyticsConfigurationPropertyToCloudFormation)(properties.analyticsConfigurations),
BucketEncryption: cfnBucketBucketEncryptionPropertyToCloudFormation(properties.bucketEncryption),
BucketName: cdk.stringToCloudFormation(properties.bucketName),
CorsConfiguration: cfnBucketCorsConfigurationPropertyToCloudFormation(properties.corsConfiguration),
InventoryConfigurations: cdk.listMapper(cfnBucketInventoryConfigurationPropertyToCloudFormation)(properties.inventoryConfigurations),
LifecycleConfiguration: cfnBucketLifecycleConfigurationPropertyToCloudFormation(properties.lifecycleConfiguration),
LoggingConfiguration: cfnBucketLoggingConfigurationPropertyToCloudFormation(properties.loggingConfiguration),
MetricsConfigurations: cdk.listMapper(cfnBucketMetricsConfigurationPropertyToCloudFormation)(properties.metricsConfigurations),
NotificationConfiguration: cfnBucketNotificationConfigurationPropertyToCloudFormation(properties.notificationConfiguration),
ObjectLockConfiguration: cfnBucketObjectLockConfigurationPropertyToCloudFormation(properties.objectLockConfiguration),
ObjectLockEnabled: cdk.booleanToCloudFormation(properties.objectLockEnabled),
PublicAccessBlockConfiguration: cfnBucketPublicAccessBlockConfigurationPropertyToCloudFormation(properties.publicAccessBlockConfiguration),
ReplicationConfiguration: cfnBucketReplicationConfigurationPropertyToCloudFormation(properties.replicationConfiguration),
Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags),
VersioningConfiguration: cfnBucketVersioningConfigurationPropertyToCloudFormation(properties.versioningConfiguration),
WebsiteConfiguration: cfnBucketWebsiteConfigurationPropertyToCloudFormation(properties.websiteConfiguration),
};
}
// @ts-ignore TS6133
function CfnBucketPropsFromCloudFormation(properties: any): CfnBucketProps {
properties = properties || {};
return {
accelerateConfiguration: properties.AccelerateConfiguration == null ? undefined : CfnBucketAccelerateConfigurationPropertyFromCloudFormation(properties.AccelerateConfiguration),
accessControl: properties.AccessControl == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.AccessControl),
analyticsConfigurations: cfn_parse.FromCloudFormation.getArray(properties.AnalyticsConfigurations, (prop1: any) => CfnBucketAnalyticsConfigurationPropertyFromCloudFormation(prop1)),
bucketEncryption: properties.BucketEncryption == null ? undefined : CfnBucketBucketEncryptionPropertyFromCloudFormation(properties.BucketEncryption),
bucketName: properties.BucketName == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.BucketName),
corsConfiguration: properties.CorsConfiguration == null ? undefined : CfnBucketCorsConfigurationPropertyFromCloudFormation(properties.CorsConfiguration),
inventoryConfigurations: cfn_parse.FromCloudFormation.getArray(properties.InventoryConfigurations, (prop1: any) => CfnBucketInventoryConfigurationPropertyFromCloudFormation(prop1)),
lifecycleConfiguration: properties.LifecycleConfiguration == null ? undefined : CfnBucketLifecycleConfigurationPropertyFromCloudFormation(properties.LifecycleConfiguration),
loggingConfiguration: properties.LoggingConfiguration == null ? undefined : CfnBucketLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration),
metricsConfigurations: cfn_parse.FromCloudFormation.getArray(properties.MetricsConfigurations, (prop1: any) => CfnBucketMetricsConfigurationPropertyFromCloudFormation(prop1)),
notificationConfiguration: properties.NotificationConfiguration == null ? undefined : CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties.NotificationConfiguration),
objectLockConfiguration: properties.ObjectLockConfiguration == null ? undefined : CfnBucketObjectLockConfigurationPropertyFromCloudFormation(properties.ObjectLockConfiguration),
objectLockEnabled: properties.ObjectLockEnabled == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.ObjectLockEnabled),
publicAccessBlockConfiguration: properties.PublicAccessBlockConfiguration == null ? undefined : CfnBucketPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration),
replicationConfiguration: properties.ReplicationConfiguration == null ? undefined : CfnBucketReplicationConfigurationPropertyFromCloudFormation(properties.ReplicationConfiguration),
tags: cfn_parse.FromCloudFormation.getArray(properties.Tags, (prop1: any) => cfn_parse.FromCloudFormation.getCfnTag(prop1) as any),
versioningConfiguration: properties.VersioningConfiguration == null ? undefined : CfnBucketVersioningConfigurationPropertyFromCloudFormation(properties.VersioningConfiguration),
websiteConfiguration: properties.WebsiteConfiguration == null ? undefined : CfnBucketWebsiteConfigurationPropertyFromCloudFormation(properties.WebsiteConfiguration),
};
}
/**
* A CloudFormation `AWS::S3::Bucket`
*
* @cloudformationResource AWS::S3::Bucket
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html
*/
export class CfnBucket extends cdk.CfnResource implements cdk.IInspectable {
/**
* The CloudFormation resource type name for this resource class.
*/
public static readonly CFN_RESOURCE_TYPE_NAME = "AWS::S3::Bucket";
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @experimental
*/
public static fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, finder: cdk.ICfnFinder): CfnBucket {
resourceAttributes = resourceAttributes || {};
const resourceProperties = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Properties);
const props = CfnBucketPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucket(scope, id, props);
const cfnOptions = ret.cfnOptions;
cfnOptions.deletionPolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.DeletionPolicy);
cfnOptions.updateReplacePolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.UpdateReplacePolicy);
cfnOptions.metadata = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Metadata);
// handle DependsOn
resourceAttributes.DependsOn = resourceAttributes.DependsOn ?? [];
const dependencies: string[] = Array.isArray(resourceAttributes.DependsOn) ? resourceAttributes.DependsOn : [resourceAttributes.DependsOn];
for (const dep of dependencies) {
const depResource = finder.findResource(dep);
if (!depResource) {
throw new Error(`Resource '${id}' depends on '${dep}' that doesn't exist`);
}
ret.node.addDependency(depResource);
}
return ret;
}
/**
* @cloudformationAttribute Arn
*/
public readonly attrArn: string;
/**
* @cloudformationAttribute DomainName
*/
public readonly attrDomainName: string;
/**
* @cloudformationAttribute DualStackDomainName
*/
public readonly attrDualStackDomainName: string;
/**
* @cloudformationAttribute RegionalDomainName
*/
public readonly attrRegionalDomainName: string;
/**
* @cloudformationAttribute WebsiteURL
*/
public readonly attrWebsiteUrl: string;
/**
* `AWS::S3::Bucket.AccelerateConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accelerateconfiguration
*/
public accelerateConfiguration: CfnBucket.AccelerateConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.AccessControl`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-accesscontrol
*/
public accessControl: string | undefined;
/**
* `AWS::S3::Bucket.AnalyticsConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-analyticsconfigurations
*/
public analyticsConfigurations: Array<CfnBucket.AnalyticsConfigurationProperty | cdk.IResolvable> | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.BucketEncryption`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-bucketencryption
*/
public bucketEncryption: CfnBucket.BucketEncryptionProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.BucketName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name
*/
public bucketName: string | undefined;
/**
* `AWS::S3::Bucket.CorsConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-crossoriginconfig
*/
public corsConfiguration: CfnBucket.CorsConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.InventoryConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-inventoryconfigurations
*/
public inventoryConfigurations: Array<CfnBucket.InventoryConfigurationProperty | cdk.IResolvable> | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.LifecycleConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-lifecycleconfig
*/
public lifecycleConfiguration: CfnBucket.LifecycleConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.LoggingConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-loggingconfig
*/
public loggingConfiguration: CfnBucket.LoggingConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.MetricsConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-metricsconfigurations
*/
public metricsConfigurations: Array<CfnBucket.MetricsConfigurationProperty | cdk.IResolvable> | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.NotificationConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-notification
*/
public notificationConfiguration: CfnBucket.NotificationConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.ObjectLockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockconfiguration
*/
public objectLockConfiguration: CfnBucket.ObjectLockConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.ObjectLockEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-objectlockenabled
*/
public objectLockEnabled: boolean | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.PublicAccessBlockConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-publicaccessblockconfiguration
*/
public publicAccessBlockConfiguration: CfnBucket.PublicAccessBlockConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.ReplicationConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-replicationconfiguration
*/
public replicationConfiguration: CfnBucket.ReplicationConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.Tags`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-tags
*/
public readonly tags: cdk.TagManager;
/**
* `AWS::S3::Bucket.VersioningConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-versioning
*/
public versioningConfiguration: CfnBucket.VersioningConfigurationProperty | cdk.IResolvable | undefined;
/**
* `AWS::S3::Bucket.WebsiteConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-websiteconfiguration
*/
public websiteConfiguration: CfnBucket.WebsiteConfigurationProperty | cdk.IResolvable | undefined;
/**
* Create a new `AWS::S3::Bucket`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope: cdk.Construct, id: string, props: CfnBucketProps = {}) {
super(scope, id, { type: CfnBucket.CFN_RESOURCE_TYPE_NAME, properties: props });
this.attrArn = cdk.Token.asString(this.getAtt('Arn'));
this.attrDomainName = cdk.Token.asString(this.getAtt('DomainName'));
this.attrDualStackDomainName = cdk.Token.asString(this.getAtt('DualStackDomainName'));
this.attrRegionalDomainName = cdk.Token.asString(this.getAtt('RegionalDomainName'));
this.attrWebsiteUrl = cdk.Token.asString(this.getAtt('WebsiteURL'));
this.accelerateConfiguration = props.accelerateConfiguration;
this.accessControl = props.accessControl;
this.analyticsConfigurations = props.analyticsConfigurations;
this.bucketEncryption = props.bucketEncryption;
this.bucketName = props.bucketName;
this.corsConfiguration = props.corsConfiguration;
this.inventoryConfigurations = props.inventoryConfigurations;
this.lifecycleConfiguration = props.lifecycleConfiguration;
this.loggingConfiguration = props.loggingConfiguration;
this.metricsConfigurations = props.metricsConfigurations;
this.notificationConfiguration = props.notificationConfiguration;
this.objectLockConfiguration = props.objectLockConfiguration;
this.objectLockEnabled = props.objectLockEnabled;
this.publicAccessBlockConfiguration = props.publicAccessBlockConfiguration;
this.replicationConfiguration = props.replicationConfiguration;
this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::S3::Bucket", props.tags, { tagPropertyName: 'tags' });
this.versioningConfiguration = props.versioningConfiguration;
this.websiteConfiguration = props.websiteConfiguration;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
* @stability experimental
*/
public inspect(inspector: cdk.TreeInspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnBucket.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
protected get cfnProperties(): { [key: string]: any } {
return {
accelerateConfiguration: this.accelerateConfiguration,
accessControl: this.accessControl,
analyticsConfigurations: this.analyticsConfigurations,
bucketEncryption: this.bucketEncryption,
bucketName: this.bucketName,
corsConfiguration: this.corsConfiguration,
inventoryConfigurations: this.inventoryConfigurations,
lifecycleConfiguration: this.lifecycleConfiguration,
loggingConfiguration: this.loggingConfiguration,
metricsConfigurations: this.metricsConfigurations,
notificationConfiguration: this.notificationConfiguration,
objectLockConfiguration: this.objectLockConfiguration,
objectLockEnabled: this.objectLockEnabled,
publicAccessBlockConfiguration: this.publicAccessBlockConfiguration,
replicationConfiguration: this.replicationConfiguration,
tags: this.tags.renderTags(),
versioningConfiguration: this.versioningConfiguration,
websiteConfiguration: this.websiteConfiguration,
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnBucketPropsToCloudFormation(props);
}
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html
*/
export interface AbortIncompleteMultipartUploadProperty {
/**
* `CfnBucket.AbortIncompleteMultipartUploadProperty.DaysAfterInitiation`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html#cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation
*/
readonly daysAfterInitiation: number;
}
}
/**
* Determine whether the given properties match those of a `AbortIncompleteMultipartUploadProperty`
*
* @param properties - the TypeScript properties of a `AbortIncompleteMultipartUploadProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AbortIncompleteMultipartUploadPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.requiredValidator)(properties.daysAfterInitiation));
errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.validateNumber)(properties.daysAfterInitiation));
return errors.wrap('supplied properties not correct for "AbortIncompleteMultipartUploadProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AbortIncompleteMultipartUpload` resource
*
* @param properties - the TypeScript properties of a `AbortIncompleteMultipartUploadProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AbortIncompleteMultipartUpload` resource.
*/
// @ts-ignore TS6133
function cfnBucketAbortIncompleteMultipartUploadPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AbortIncompleteMultipartUploadPropertyValidator(properties).assertSuccess();
return {
DaysAfterInitiation: cdk.numberToCloudFormation(properties.daysAfterInitiation),
};
}
// @ts-ignore TS6133
function CfnBucketAbortIncompleteMultipartUploadPropertyFromCloudFormation(properties: any): CfnBucket.AbortIncompleteMultipartUploadProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
daysAfterInitiation: cfn_parse.FromCloudFormation.getNumber(properties.DaysAfterInitiation),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accelerateconfiguration.html
*/
export interface AccelerateConfigurationProperty {
/**
* `CfnBucket.AccelerateConfigurationProperty.AccelerationStatus`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accelerateconfiguration.html#cfn-s3-bucket-accelerateconfiguration-accelerationstatus
*/
readonly accelerationStatus: string;
}
}
/**
* Determine whether the given properties match those of a `AccelerateConfigurationProperty`
*
* @param properties - the TypeScript properties of a `AccelerateConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AccelerateConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accelerationStatus', cdk.requiredValidator)(properties.accelerationStatus));
errors.collect(cdk.propertyValidator('accelerationStatus', cdk.validateString)(properties.accelerationStatus));
return errors.wrap('supplied properties not correct for "AccelerateConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AccelerateConfiguration` resource
*
* @param properties - the TypeScript properties of a `AccelerateConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AccelerateConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketAccelerateConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AccelerateConfigurationPropertyValidator(properties).assertSuccess();
return {
AccelerationStatus: cdk.stringToCloudFormation(properties.accelerationStatus),
};
}
// @ts-ignore TS6133
function CfnBucketAccelerateConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.AccelerateConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
accelerationStatus: cfn_parse.FromCloudFormation.getString(properties.AccelerationStatus),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html
*/
export interface AccessControlTranslationProperty {
/**
* `CfnBucket.AccessControlTranslationProperty.Owner`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html#cfn-s3-bucket-accesscontroltranslation-owner
*/
readonly owner: string;
}
}
/**
* Determine whether the given properties match those of a `AccessControlTranslationProperty`
*
* @param properties - the TypeScript properties of a `AccessControlTranslationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AccessControlTranslationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('owner', cdk.requiredValidator)(properties.owner));
errors.collect(cdk.propertyValidator('owner', cdk.validateString)(properties.owner));
return errors.wrap('supplied properties not correct for "AccessControlTranslationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AccessControlTranslation` resource
*
* @param properties - the TypeScript properties of a `AccessControlTranslationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AccessControlTranslation` resource.
*/
// @ts-ignore TS6133
function cfnBucketAccessControlTranslationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AccessControlTranslationPropertyValidator(properties).assertSuccess();
return {
Owner: cdk.stringToCloudFormation(properties.owner),
};
}
// @ts-ignore TS6133
function CfnBucketAccessControlTranslationPropertyFromCloudFormation(properties: any): CfnBucket.AccessControlTranslationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
owner: cfn_parse.FromCloudFormation.getString(properties.Owner),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html
*/
export interface AnalyticsConfigurationProperty {
/**
* `CfnBucket.AnalyticsConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.AnalyticsConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.AnalyticsConfigurationProperty.StorageClassAnalysis`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-storageclassanalysis
*/
readonly storageClassAnalysis: CfnBucket.StorageClassAnalysisProperty | cdk.IResolvable;
/**
* `CfnBucket.AnalyticsConfigurationProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `AnalyticsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `AnalyticsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AnalyticsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('storageClassAnalysis', cdk.requiredValidator)(properties.storageClassAnalysis));
errors.collect(cdk.propertyValidator('storageClassAnalysis', CfnBucket_StorageClassAnalysisPropertyValidator)(properties.storageClassAnalysis));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
return errors.wrap('supplied properties not correct for "AnalyticsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AnalyticsConfiguration` resource
*
* @param properties - the TypeScript properties of a `AnalyticsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AnalyticsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketAnalyticsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AnalyticsConfigurationPropertyValidator(properties).assertSuccess();
return {
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
StorageClassAnalysis: cfnBucketStorageClassAnalysisPropertyToCloudFormation(properties.storageClassAnalysis),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
};
}
// @ts-ignore TS6133
function CfnBucketAnalyticsConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.AnalyticsConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
id: cfn_parse.FromCloudFormation.getString(properties.Id),
prefix: properties.Prefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Prefix),
storageClassAnalysis: CfnBucketStorageClassAnalysisPropertyFromCloudFormation(properties.StorageClassAnalysis),
tagFilters: cfn_parse.FromCloudFormation.getArray(properties.TagFilters, (prop1: any) => CfnBucketTagFilterPropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-bucketencryption.html
*/
export interface BucketEncryptionProperty {
/**
* `CfnBucket.BucketEncryptionProperty.ServerSideEncryptionConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-bucketencryption.html#cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration
*/
readonly serverSideEncryptionConfiguration: Array<CfnBucket.ServerSideEncryptionRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `BucketEncryptionProperty`
*
* @param properties - the TypeScript properties of a `BucketEncryptionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_BucketEncryptionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.requiredValidator)(properties.serverSideEncryptionConfiguration));
errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.listValidator(CfnBucket_ServerSideEncryptionRulePropertyValidator))(properties.serverSideEncryptionConfiguration));
return errors.wrap('supplied properties not correct for "BucketEncryptionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.BucketEncryption` resource
*
* @param properties - the TypeScript properties of a `BucketEncryptionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.BucketEncryption` resource.
*/
// @ts-ignore TS6133
function cfnBucketBucketEncryptionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_BucketEncryptionPropertyValidator(properties).assertSuccess();
return {
ServerSideEncryptionConfiguration: cdk.listMapper(cfnBucketServerSideEncryptionRulePropertyToCloudFormation)(properties.serverSideEncryptionConfiguration),
};
}
// @ts-ignore TS6133
function CfnBucketBucketEncryptionPropertyFromCloudFormation(properties: any): CfnBucket.BucketEncryptionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
serverSideEncryptionConfiguration: cfn_parse.FromCloudFormation.getArray(properties.ServerSideEncryptionConfiguration, (prop1: any) => CfnBucketServerSideEncryptionRulePropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html
*/
export interface CorsConfigurationProperty {
/**
* `CfnBucket.CorsConfigurationProperty.CorsRules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html#cfn-s3-bucket-cors-corsrule
*/
readonly corsRules: Array<CfnBucket.CorsRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `CorsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `CorsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_CorsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('corsRules', cdk.requiredValidator)(properties.corsRules));
errors.collect(cdk.propertyValidator('corsRules', cdk.listValidator(CfnBucket_CorsRulePropertyValidator))(properties.corsRules));
return errors.wrap('supplied properties not correct for "CorsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsConfiguration` resource
*
* @param properties - the TypeScript properties of a `CorsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketCorsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_CorsConfigurationPropertyValidator(properties).assertSuccess();
return {
CorsRules: cdk.listMapper(cfnBucketCorsRulePropertyToCloudFormation)(properties.corsRules),
};
}
// @ts-ignore TS6133
function CfnBucketCorsConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.CorsConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
corsRules: cfn_parse.FromCloudFormation.getArray(properties.CorsRules, (prop1: any) => CfnBucketCorsRulePropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html
*/
export interface CorsRuleProperty {
/**
* `CfnBucket.CorsRuleProperty.AllowedHeaders`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedheaders
*/
readonly allowedHeaders?: string[];
/**
* `CfnBucket.CorsRuleProperty.AllowedMethods`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedmethods
*/
readonly allowedMethods: string[];
/**
* `CfnBucket.CorsRuleProperty.AllowedOrigins`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedorigins
*/
readonly allowedOrigins: string[];
/**
* `CfnBucket.CorsRuleProperty.ExposedHeaders`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-exposedheaders
*/
readonly exposedHeaders?: string[];
/**
* `CfnBucket.CorsRuleProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-id
*/
readonly id?: string;
/**
* `CfnBucket.CorsRuleProperty.MaxAge`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-maxage
*/
readonly maxAge?: number;
}
}
/**
* Determine whether the given properties match those of a `CorsRuleProperty`
*
* @param properties - the TypeScript properties of a `CorsRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_CorsRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('allowedHeaders', cdk.listValidator(cdk.validateString))(properties.allowedHeaders));
errors.collect(cdk.propertyValidator('allowedMethods', cdk.requiredValidator)(properties.allowedMethods));
errors.collect(cdk.propertyValidator('allowedMethods', cdk.listValidator(cdk.validateString))(properties.allowedMethods));
errors.collect(cdk.propertyValidator('allowedOrigins', cdk.requiredValidator)(properties.allowedOrigins));
errors.collect(cdk.propertyValidator('allowedOrigins', cdk.listValidator(cdk.validateString))(properties.allowedOrigins));
errors.collect(cdk.propertyValidator('exposedHeaders', cdk.listValidator(cdk.validateString))(properties.exposedHeaders));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('maxAge', cdk.validateNumber)(properties.maxAge));
return errors.wrap('supplied properties not correct for "CorsRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsRule` resource
*
* @param properties - the TypeScript properties of a `CorsRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketCorsRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_CorsRulePropertyValidator(properties).assertSuccess();
return {
AllowedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedHeaders),
AllowedMethods: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedMethods),
AllowedOrigins: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedOrigins),
ExposedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.exposedHeaders),
Id: cdk.stringToCloudFormation(properties.id),
MaxAge: cdk.numberToCloudFormation(properties.maxAge),
};
}
// @ts-ignore TS6133
function CfnBucketCorsRulePropertyFromCloudFormation(properties: any): CfnBucket.CorsRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
allowedHeaders: cfn_parse.FromCloudFormation.getStringArray(properties.AllowedHeaders),
allowedMethods: cfn_parse.FromCloudFormation.getStringArray(properties.AllowedMethods),
allowedOrigins: cfn_parse.FromCloudFormation.getStringArray(properties.AllowedOrigins),
exposedHeaders: cfn_parse.FromCloudFormation.getStringArray(properties.ExposedHeaders),
id: properties.Id == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Id),
maxAge: properties.MaxAge == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.MaxAge),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html
*/
export interface DataExportProperty {
/**
* `CfnBucket.DataExportProperty.Destination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-destination
*/
readonly destination: CfnBucket.DestinationProperty | cdk.IResolvable;
/**
* `CfnBucket.DataExportProperty.OutputSchemaVersion`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-outputschemaversion
*/
readonly outputSchemaVersion: string;
}
}
/**
* Determine whether the given properties match those of a `DataExportProperty`
*
* @param properties - the TypeScript properties of a `DataExportProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DataExportPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_DestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.requiredValidator)(properties.outputSchemaVersion));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.validateString)(properties.outputSchemaVersion));
return errors.wrap('supplied properties not correct for "DataExportProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.DataExport` resource
*
* @param properties - the TypeScript properties of a `DataExportProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.DataExport` resource.
*/
// @ts-ignore TS6133
function cfnBucketDataExportPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DataExportPropertyValidator(properties).assertSuccess();
return {
Destination: cfnBucketDestinationPropertyToCloudFormation(properties.destination),
OutputSchemaVersion: cdk.stringToCloudFormation(properties.outputSchemaVersion),
};
}
// @ts-ignore TS6133
function CfnBucketDataExportPropertyFromCloudFormation(properties: any): CfnBucket.DataExportProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
destination: CfnBucketDestinationPropertyFromCloudFormation(properties.Destination),
outputSchemaVersion: cfn_parse.FromCloudFormation.getString(properties.OutputSchemaVersion),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html
*/
export interface DefaultRetentionProperty {
/**
* `CfnBucket.DefaultRetentionProperty.Days`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-days
*/
readonly days?: number;
/**
* `CfnBucket.DefaultRetentionProperty.Mode`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-mode
*/
readonly mode?: string;
/**
* `CfnBucket.DefaultRetentionProperty.Years`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-years
*/
readonly years?: number;
}
}
/**
* Determine whether the given properties match those of a `DefaultRetentionProperty`
*
* @param properties - the TypeScript properties of a `DefaultRetentionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DefaultRetentionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('days', cdk.validateNumber)(properties.days));
errors.collect(cdk.propertyValidator('mode', cdk.validateString)(properties.mode));
errors.collect(cdk.propertyValidator('years', cdk.validateNumber)(properties.years));
return errors.wrap('supplied properties not correct for "DefaultRetentionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.DefaultRetention` resource
*
* @param properties - the TypeScript properties of a `DefaultRetentionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.DefaultRetention` resource.
*/
// @ts-ignore TS6133
function cfnBucketDefaultRetentionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DefaultRetentionPropertyValidator(properties).assertSuccess();
return {
Days: cdk.numberToCloudFormation(properties.days),
Mode: cdk.stringToCloudFormation(properties.mode),
Years: cdk.numberToCloudFormation(properties.years),
};
}
// @ts-ignore TS6133
function CfnBucketDefaultRetentionPropertyFromCloudFormation(properties: any): CfnBucket.DefaultRetentionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
days: properties.Days == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.Days),
mode: properties.Mode == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Mode),
years: properties.Years == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.Years),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html
*/
export interface DestinationProperty {
/**
* `CfnBucket.DestinationProperty.BucketAccountId`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketaccountid
*/
readonly bucketAccountId?: string;
/**
* `CfnBucket.DestinationProperty.BucketArn`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketarn
*/
readonly bucketArn: string;
/**
* `CfnBucket.DestinationProperty.Format`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-format
*/
readonly format: string;
/**
* `CfnBucket.DestinationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-prefix
*/
readonly prefix?: string;
}
}
/**
* Determine whether the given properties match those of a `DestinationProperty`
*
* @param properties - the TypeScript properties of a `DestinationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DestinationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('bucketAccountId', cdk.validateString)(properties.bucketAccountId));
errors.collect(cdk.propertyValidator('bucketArn', cdk.requiredValidator)(properties.bucketArn));
errors.collect(cdk.propertyValidator('bucketArn', cdk.validateString)(properties.bucketArn));
errors.collect(cdk.propertyValidator('format', cdk.requiredValidator)(properties.format));
errors.collect(cdk.propertyValidator('format', cdk.validateString)(properties.format));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
return errors.wrap('supplied properties not correct for "DestinationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Destination` resource
*
* @param properties - the TypeScript properties of a `DestinationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Destination` resource.
*/
// @ts-ignore TS6133
function cfnBucketDestinationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DestinationPropertyValidator(properties).assertSuccess();
return {
BucketAccountId: cdk.stringToCloudFormation(properties.bucketAccountId),
BucketArn: cdk.stringToCloudFormation(properties.bucketArn),
Format: cdk.stringToCloudFormation(properties.format),
Prefix: cdk.stringToCloudFormation(properties.prefix),
};
}
// @ts-ignore TS6133
function CfnBucketDestinationPropertyFromCloudFormation(properties: any): CfnBucket.DestinationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
bucketAccountId: properties.BucketAccountId == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.BucketAccountId),
bucketArn: cfn_parse.FromCloudFormation.getString(properties.BucketArn),
format: cfn_parse.FromCloudFormation.getString(properties.Format),
prefix: properties.Prefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Prefix),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-encryptionconfiguration.html
*/
export interface EncryptionConfigurationProperty {
/**
* `CfnBucket.EncryptionConfigurationProperty.ReplicaKmsKeyID`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-encryptionconfiguration.html#cfn-s3-bucket-encryptionconfiguration-replicakmskeyid
*/
readonly replicaKmsKeyId: string;
}
}
/**
* Determine whether the given properties match those of a `EncryptionConfigurationProperty`
*
* @param properties - the TypeScript properties of a `EncryptionConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_EncryptionConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.requiredValidator)(properties.replicaKmsKeyId));
errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.validateString)(properties.replicaKmsKeyId));
return errors.wrap('supplied properties not correct for "EncryptionConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.EncryptionConfiguration` resource
*
* @param properties - the TypeScript properties of a `EncryptionConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.EncryptionConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketEncryptionConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_EncryptionConfigurationPropertyValidator(properties).assertSuccess();
return {
ReplicaKmsKeyID: cdk.stringToCloudFormation(properties.replicaKmsKeyId),
};
}
// @ts-ignore TS6133
function CfnBucketEncryptionConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.EncryptionConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
replicaKmsKeyId: cfn_parse.FromCloudFormation.getString(properties.ReplicaKmsKeyID),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html
*/
export interface FilterRuleProperty {
/**
* `CfnBucket.FilterRuleProperty.Name`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-name
*/
readonly name: string;
/**
* `CfnBucket.FilterRuleProperty.Value`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-value
*/
readonly value: string;
}
}
/**
* Determine whether the given properties match those of a `FilterRuleProperty`
*
* @param properties - the TypeScript properties of a `FilterRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_FilterRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));
errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));
errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
return errors.wrap('supplied properties not correct for "FilterRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.FilterRule` resource
*
* @param properties - the TypeScript properties of a `FilterRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.FilterRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketFilterRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_FilterRulePropertyValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
Value: cdk.stringToCloudFormation(properties.value),
};
}
// @ts-ignore TS6133
function CfnBucketFilterRulePropertyFromCloudFormation(properties: any): CfnBucket.FilterRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
name: cfn_parse.FromCloudFormation.getString(properties.Name),
value: cfn_parse.FromCloudFormation.getString(properties.Value),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html
*/
export interface InventoryConfigurationProperty {
/**
* `CfnBucket.InventoryConfigurationProperty.Destination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-destination
*/
readonly destination: CfnBucket.DestinationProperty | cdk.IResolvable;
/**
* `CfnBucket.InventoryConfigurationProperty.Enabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-enabled
*/
readonly enabled: boolean | cdk.IResolvable;
/**
* `CfnBucket.InventoryConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.InventoryConfigurationProperty.IncludedObjectVersions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-includedobjectversions
*/
readonly includedObjectVersions: string;
/**
* `CfnBucket.InventoryConfigurationProperty.OptionalFields`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-optionalfields
*/
readonly optionalFields?: string[];
/**
* `CfnBucket.InventoryConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.InventoryConfigurationProperty.ScheduleFrequency`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-schedulefrequency
*/
readonly scheduleFrequency: string;
}
}
/**
* Determine whether the given properties match those of a `InventoryConfigurationProperty`
*
* @param properties - the TypeScript properties of a `InventoryConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_InventoryConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_DestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('enabled', cdk.requiredValidator)(properties.enabled));
errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled));
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.requiredValidator)(properties.includedObjectVersions));
errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.validateString)(properties.includedObjectVersions));
errors.collect(cdk.propertyValidator('optionalFields', cdk.listValidator(cdk.validateString))(properties.optionalFields));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.requiredValidator)(properties.scheduleFrequency));
errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.validateString)(properties.scheduleFrequency));
return errors.wrap('supplied properties not correct for "InventoryConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.InventoryConfiguration` resource
*
* @param properties - the TypeScript properties of a `InventoryConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.InventoryConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketInventoryConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_InventoryConfigurationPropertyValidator(properties).assertSuccess();
return {
Destination: cfnBucketDestinationPropertyToCloudFormation(properties.destination),
Enabled: cdk.booleanToCloudFormation(properties.enabled),
Id: cdk.stringToCloudFormation(properties.id),
IncludedObjectVersions: cdk.stringToCloudFormation(properties.includedObjectVersions),
OptionalFields: cdk.listMapper(cdk.stringToCloudFormation)(properties.optionalFields),
Prefix: cdk.stringToCloudFormation(properties.prefix),
ScheduleFrequency: cdk.stringToCloudFormation(properties.scheduleFrequency),
};
}
// @ts-ignore TS6133
function CfnBucketInventoryConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.InventoryConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
destination: CfnBucketDestinationPropertyFromCloudFormation(properties.Destination),
enabled: cfn_parse.FromCloudFormation.getBoolean(properties.Enabled),
id: cfn_parse.FromCloudFormation.getString(properties.Id),
includedObjectVersions: cfn_parse.FromCloudFormation.getString(properties.IncludedObjectVersions),
optionalFields: cfn_parse.FromCloudFormation.getStringArray(properties.OptionalFields),
prefix: properties.Prefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Prefix),
scheduleFrequency: cfn_parse.FromCloudFormation.getString(properties.ScheduleFrequency),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html
*/
export interface LambdaConfigurationProperty {
/**
* `CfnBucket.LambdaConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-event
*/
readonly event: string;
/**
* `CfnBucket.LambdaConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.LambdaConfigurationProperty.Function`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-function
*/
readonly function: string;
}
}
/**
* Determine whether the given properties match those of a `LambdaConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LambdaConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LambdaConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('function', cdk.requiredValidator)(properties.function));
errors.collect(cdk.propertyValidator('function', cdk.validateString)(properties.function));
return errors.wrap('supplied properties not correct for "LambdaConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LambdaConfiguration` resource
*
* @param properties - the TypeScript properties of a `LambdaConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LambdaConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLambdaConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LambdaConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Function: cdk.stringToCloudFormation(properties.function),
};
}
// @ts-ignore TS6133
function CfnBucketLambdaConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.LambdaConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
event: cfn_parse.FromCloudFormation.getString(properties.Event),
filter: properties.Filter == null ? undefined : CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter),
function: cfn_parse.FromCloudFormation.getString(properties.Function),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig.html
*/
export interface LifecycleConfigurationProperty {
/**
* `CfnBucket.LifecycleConfigurationProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig.html#cfn-s3-bucket-lifecycleconfig-rules
*/
readonly rules: Array<CfnBucket.RuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `LifecycleConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LifecycleConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LifecycleConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_RulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "LifecycleConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LifecycleConfiguration` resource
*
* @param properties - the TypeScript properties of a `LifecycleConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LifecycleConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLifecycleConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LifecycleConfigurationPropertyValidator(properties).assertSuccess();
return {
Rules: cdk.listMapper(cfnBucketRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketLifecycleConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.LifecycleConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
rules: cfn_parse.FromCloudFormation.getArray(properties.Rules, (prop1: any) => CfnBucketRulePropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html
*/
export interface LoggingConfigurationProperty {
/**
* `CfnBucket.LoggingConfigurationProperty.DestinationBucketName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-destinationbucketname
*/
readonly destinationBucketName?: string;
/**
* `CfnBucket.LoggingConfigurationProperty.LogFilePrefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-logfileprefix
*/
readonly logFilePrefix?: string;
}
}
/**
* Determine whether the given properties match those of a `LoggingConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LoggingConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LoggingConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destinationBucketName', cdk.validateString)(properties.destinationBucketName));
errors.collect(cdk.propertyValidator('logFilePrefix', cdk.validateString)(properties.logFilePrefix));
return errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LoggingConfiguration` resource
*
* @param properties - the TypeScript properties of a `LoggingConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LoggingConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLoggingConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LoggingConfigurationPropertyValidator(properties).assertSuccess();
return {
DestinationBucketName: cdk.stringToCloudFormation(properties.destinationBucketName),
LogFilePrefix: cdk.stringToCloudFormation(properties.logFilePrefix),
};
}
// @ts-ignore TS6133
function CfnBucketLoggingConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.LoggingConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
destinationBucketName: properties.DestinationBucketName == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.DestinationBucketName),
logFilePrefix: properties.LogFilePrefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.LogFilePrefix),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html
*/
export interface MetricsConfigurationProperty {
/**
* `CfnBucket.MetricsConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.MetricsConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.MetricsConfigurationProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `MetricsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `MetricsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_MetricsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
return errors.wrap('supplied properties not correct for "MetricsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.MetricsConfiguration` resource
*
* @param properties - the TypeScript properties of a `MetricsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.MetricsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketMetricsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_MetricsConfigurationPropertyValidator(properties).assertSuccess();
return {
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
};
}
// @ts-ignore TS6133
function CfnBucketMetricsConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.MetricsConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
id: cfn_parse.FromCloudFormation.getString(properties.Id),
prefix: properties.Prefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Prefix),
tagFilters: cfn_parse.FromCloudFormation.getArray(properties.TagFilters, (prop1: any) => CfnBucketTagFilterPropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html
*/
export interface NoncurrentVersionTransitionProperty {
/**
* `CfnBucket.NoncurrentVersionTransitionProperty.StorageClass`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-storageclass
*/
readonly storageClass: string;
/**
* `CfnBucket.NoncurrentVersionTransitionProperty.TransitionInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-transitionindays
*/
readonly transitionInDays: number;
}
}
/**
* Determine whether the given properties match those of a `NoncurrentVersionTransitionProperty`
*
* @param properties - the TypeScript properties of a `NoncurrentVersionTransitionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NoncurrentVersionTransitionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.requiredValidator)(properties.transitionInDays));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
return errors.wrap('supplied properties not correct for "NoncurrentVersionTransitionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NoncurrentVersionTransition` resource
*
* @param properties - the TypeScript properties of a `NoncurrentVersionTransitionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NoncurrentVersionTransition` resource.
*/
// @ts-ignore TS6133
function cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NoncurrentVersionTransitionPropertyValidator(properties).assertSuccess();
return {
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
};
}
// @ts-ignore TS6133
function CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(properties: any): CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
storageClass: cfn_parse.FromCloudFormation.getString(properties.StorageClass),
transitionInDays: cfn_parse.FromCloudFormation.getNumber(properties.TransitionInDays),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html
*/
export interface NotificationConfigurationProperty {
/**
* `CfnBucket.NotificationConfigurationProperty.LambdaConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig
*/
readonly lambdaConfigurations?: Array<CfnBucket.LambdaConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.NotificationConfigurationProperty.QueueConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-queueconfig
*/
readonly queueConfigurations?: Array<CfnBucket.QueueConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.NotificationConfigurationProperty.TopicConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-topicconfig
*/
readonly topicConfigurations?: Array<CfnBucket.TopicConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `NotificationConfigurationProperty`
*
* @param properties - the TypeScript properties of a `NotificationConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NotificationConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('lambdaConfigurations', cdk.listValidator(CfnBucket_LambdaConfigurationPropertyValidator))(properties.lambdaConfigurations));
errors.collect(cdk.propertyValidator('queueConfigurations', cdk.listValidator(CfnBucket_QueueConfigurationPropertyValidator))(properties.queueConfigurations));
errors.collect(cdk.propertyValidator('topicConfigurations', cdk.listValidator(CfnBucket_TopicConfigurationPropertyValidator))(properties.topicConfigurations));
return errors.wrap('supplied properties not correct for "NotificationConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationConfiguration` resource
*
* @param properties - the TypeScript properties of a `NotificationConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketNotificationConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NotificationConfigurationPropertyValidator(properties).assertSuccess();
return {
LambdaConfigurations: cdk.listMapper(cfnBucketLambdaConfigurationPropertyToCloudFormation)(properties.lambdaConfigurations),
QueueConfigurations: cdk.listMapper(cfnBucketQueueConfigurationPropertyToCloudFormation)(properties.queueConfigurations),
TopicConfigurations: cdk.listMapper(cfnBucketTopicConfigurationPropertyToCloudFormation)(properties.topicConfigurations),
};
}
// @ts-ignore TS6133
function CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.NotificationConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
lambdaConfigurations: cfn_parse.FromCloudFormation.getArray(properties.LambdaConfigurations, (prop1: any) => CfnBucketLambdaConfigurationPropertyFromCloudFormation(prop1)),
queueConfigurations: cfn_parse.FromCloudFormation.getArray(properties.QueueConfigurations, (prop1: any) => CfnBucketQueueConfigurationPropertyFromCloudFormation(prop1)),
topicConfigurations: cfn_parse.FromCloudFormation.getArray(properties.TopicConfigurations, (prop1: any) => CfnBucketTopicConfigurationPropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html
*/
export interface NotificationFilterProperty {
/**
* `CfnBucket.NotificationFilterProperty.S3Key`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key
*/
readonly s3Key: CfnBucket.S3KeyFilterProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `NotificationFilterProperty`
*
* @param properties - the TypeScript properties of a `NotificationFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NotificationFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('s3Key', cdk.requiredValidator)(properties.s3Key));
errors.collect(cdk.propertyValidator('s3Key', CfnBucket_S3KeyFilterPropertyValidator)(properties.s3Key));
return errors.wrap('supplied properties not correct for "NotificationFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationFilter` resource
*
* @param properties - the TypeScript properties of a `NotificationFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketNotificationFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NotificationFilterPropertyValidator(properties).assertSuccess();
return {
S3Key: cfnBucketS3KeyFilterPropertyToCloudFormation(properties.s3Key),
};
}
// @ts-ignore TS6133
function CfnBucketNotificationFilterPropertyFromCloudFormation(properties: any): CfnBucket.NotificationFilterProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
s3Key: CfnBucketS3KeyFilterPropertyFromCloudFormation(properties.S3Key),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html
*/
export interface ObjectLockConfigurationProperty {
/**
* `CfnBucket.ObjectLockConfigurationProperty.ObjectLockEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-objectlockenabled
*/
readonly objectLockEnabled?: string;
/**
* `CfnBucket.ObjectLockConfigurationProperty.Rule`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-rule
*/
readonly rule?: CfnBucket.ObjectLockRuleProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ObjectLockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `ObjectLockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ObjectLockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('objectLockEnabled', cdk.validateString)(properties.objectLockEnabled));
errors.collect(cdk.propertyValidator('rule', CfnBucket_ObjectLockRulePropertyValidator)(properties.rule));
return errors.wrap('supplied properties not correct for "ObjectLockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockConfiguration` resource
*
* @param properties - the TypeScript properties of a `ObjectLockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketObjectLockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ObjectLockConfigurationPropertyValidator(properties).assertSuccess();
return {
ObjectLockEnabled: cdk.stringToCloudFormation(properties.objectLockEnabled),
Rule: cfnBucketObjectLockRulePropertyToCloudFormation(properties.rule),
};
}
// @ts-ignore TS6133
function CfnBucketObjectLockConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.ObjectLockConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
objectLockEnabled: properties.ObjectLockEnabled == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.ObjectLockEnabled),
rule: properties.Rule == null ? undefined : CfnBucketObjectLockRulePropertyFromCloudFormation(properties.Rule),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html
*/
export interface ObjectLockRuleProperty {
/**
* `CfnBucket.ObjectLockRuleProperty.DefaultRetention`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html#cfn-s3-bucket-objectlockrule-defaultretention
*/
readonly defaultRetention?: CfnBucket.DefaultRetentionProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ObjectLockRuleProperty`
*
* @param properties - the TypeScript properties of a `ObjectLockRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ObjectLockRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('defaultRetention', CfnBucket_DefaultRetentionPropertyValidator)(properties.defaultRetention));
return errors.wrap('supplied properties not correct for "ObjectLockRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockRule` resource
*
* @param properties - the TypeScript properties of a `ObjectLockRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketObjectLockRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ObjectLockRulePropertyValidator(properties).assertSuccess();
return {
DefaultRetention: cfnBucketDefaultRetentionPropertyToCloudFormation(properties.defaultRetention),
};
}
// @ts-ignore TS6133
function CfnBucketObjectLockRulePropertyFromCloudFormation(properties: any): CfnBucket.ObjectLockRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
defaultRetention: properties.DefaultRetention == null ? undefined : CfnBucketDefaultRetentionPropertyFromCloudFormation(properties.DefaultRetention),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html
*/
export interface PublicAccessBlockConfigurationProperty {
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.BlockPublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls
*/
readonly blockPublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.BlockPublicPolicy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy
*/
readonly blockPublicPolicy?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.IgnorePublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls
*/
readonly ignorePublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.RestrictPublicBuckets`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets
*/
readonly restrictPublicBuckets?: boolean | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PublicAccessBlockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_PublicAccessBlockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('blockPublicAcls', cdk.validateBoolean)(properties.blockPublicAcls));
errors.collect(cdk.propertyValidator('blockPublicPolicy', cdk.validateBoolean)(properties.blockPublicPolicy));
errors.collect(cdk.propertyValidator('ignorePublicAcls', cdk.validateBoolean)(properties.ignorePublicAcls));
errors.collect(cdk.propertyValidator('restrictPublicBuckets', cdk.validateBoolean)(properties.restrictPublicBuckets));
return errors.wrap('supplied properties not correct for "PublicAccessBlockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.PublicAccessBlockConfiguration` resource
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.PublicAccessBlockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketPublicAccessBlockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_PublicAccessBlockConfigurationPropertyValidator(properties).assertSuccess();
return {
BlockPublicAcls: cdk.booleanToCloudFormation(properties.blockPublicAcls),
BlockPublicPolicy: cdk.booleanToCloudFormation(properties.blockPublicPolicy),
IgnorePublicAcls: cdk.booleanToCloudFormation(properties.ignorePublicAcls),
RestrictPublicBuckets: cdk.booleanToCloudFormation(properties.restrictPublicBuckets),
};
}
// @ts-ignore TS6133
function CfnBucketPublicAccessBlockConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.PublicAccessBlockConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
blockPublicAcls: properties.BlockPublicAcls == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls),
blockPublicPolicy: properties.BlockPublicPolicy == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy),
ignorePublicAcls: properties.IgnorePublicAcls == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls),
restrictPublicBuckets: properties.RestrictPublicBuckets == null ? undefined : cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html
*/
export interface QueueConfigurationProperty {
/**
* `CfnBucket.QueueConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-event
*/
readonly event: string;
/**
* `CfnBucket.QueueConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.QueueConfigurationProperty.Queue`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-queue
*/
readonly queue: string;
}
}
/**
* Determine whether the given properties match those of a `QueueConfigurationProperty`
*
* @param properties - the TypeScript properties of a `QueueConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_QueueConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('queue', cdk.requiredValidator)(properties.queue));
errors.collect(cdk.propertyValidator('queue', cdk.validateString)(properties.queue));
return errors.wrap('supplied properties not correct for "QueueConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.QueueConfiguration` resource
*
* @param properties - the TypeScript properties of a `QueueConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.QueueConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketQueueConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_QueueConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Queue: cdk.stringToCloudFormation(properties.queue),
};
}
// @ts-ignore TS6133
function CfnBucketQueueConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.QueueConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
event: cfn_parse.FromCloudFormation.getString(properties.Event),
filter: properties.Filter == null ? undefined : CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter),
queue: cfn_parse.FromCloudFormation.getString(properties.Queue),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html
*/
export interface RedirectAllRequestsToProperty {
/**
* `CfnBucket.RedirectAllRequestsToProperty.HostName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-hostname
*/
readonly hostName: string;
/**
* `CfnBucket.RedirectAllRequestsToProperty.Protocol`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-protocol
*/
readonly protocol?: string;
}
}
/**
* Determine whether the given properties match those of a `RedirectAllRequestsToProperty`
*
* @param properties - the TypeScript properties of a `RedirectAllRequestsToProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RedirectAllRequestsToPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('hostName', cdk.requiredValidator)(properties.hostName));
errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
return errors.wrap('supplied properties not correct for "RedirectAllRequestsToProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectAllRequestsTo` resource
*
* @param properties - the TypeScript properties of a `RedirectAllRequestsToProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectAllRequestsTo` resource.
*/
// @ts-ignore TS6133
function cfnBucketRedirectAllRequestsToPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RedirectAllRequestsToPropertyValidator(properties).assertSuccess();
return {
HostName: cdk.stringToCloudFormation(properties.hostName),
Protocol: cdk.stringToCloudFormation(properties.protocol),
};
}
// @ts-ignore TS6133
function CfnBucketRedirectAllRequestsToPropertyFromCloudFormation(properties: any): CfnBucket.RedirectAllRequestsToProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
hostName: cfn_parse.FromCloudFormation.getString(properties.HostName),
protocol: properties.Protocol == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Protocol),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html
*/
export interface RedirectRuleProperty {
/**
* `CfnBucket.RedirectRuleProperty.HostName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-hostname
*/
readonly hostName?: string;
/**
* `CfnBucket.RedirectRuleProperty.HttpRedirectCode`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-httpredirectcode
*/
readonly httpRedirectCode?: string;
/**
* `CfnBucket.RedirectRuleProperty.Protocol`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-protocol
*/
readonly protocol?: string;
/**
* `CfnBucket.RedirectRuleProperty.ReplaceKeyPrefixWith`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeyprefixwith
*/
readonly replaceKeyPrefixWith?: string;
/**
* `CfnBucket.RedirectRuleProperty.ReplaceKeyWith`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeywith
*/
readonly replaceKeyWith?: string;
}
}
/**
* Determine whether the given properties match those of a `RedirectRuleProperty`
*
* @param properties - the TypeScript properties of a `RedirectRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RedirectRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
errors.collect(cdk.propertyValidator('httpRedirectCode', cdk.validateString)(properties.httpRedirectCode));
errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
errors.collect(cdk.propertyValidator('replaceKeyPrefixWith', cdk.validateString)(properties.replaceKeyPrefixWith));
errors.collect(cdk.propertyValidator('replaceKeyWith', cdk.validateString)(properties.replaceKeyWith));
return errors.wrap('supplied properties not correct for "RedirectRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectRule` resource
*
* @param properties - the TypeScript properties of a `RedirectRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRedirectRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RedirectRulePropertyValidator(properties).assertSuccess();
return {
HostName: cdk.stringToCloudFormation(properties.hostName),
HttpRedirectCode: cdk.stringToCloudFormation(properties.httpRedirectCode),
Protocol: cdk.stringToCloudFormation(properties.protocol),
ReplaceKeyPrefixWith: cdk.stringToCloudFormation(properties.replaceKeyPrefixWith),
ReplaceKeyWith: cdk.stringToCloudFormation(properties.replaceKeyWith),
};
}
// @ts-ignore TS6133
function CfnBucketRedirectRulePropertyFromCloudFormation(properties: any): CfnBucket.RedirectRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
hostName: properties.HostName == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.HostName),
httpRedirectCode: properties.HttpRedirectCode == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.HttpRedirectCode),
protocol: properties.Protocol == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Protocol),
replaceKeyPrefixWith: properties.ReplaceKeyPrefixWith == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyPrefixWith),
replaceKeyWith: properties.ReplaceKeyWith == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyWith),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html
*/
export interface ReplicationConfigurationProperty {
/**
* `CfnBucket.ReplicationConfigurationProperty.Role`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-role
*/
readonly role: string;
/**
* `CfnBucket.ReplicationConfigurationProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-rules
*/
readonly rules: Array<CfnBucket.ReplicationRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ReplicationConfigurationProperty`
*
* @param properties - the TypeScript properties of a `ReplicationConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('role', cdk.requiredValidator)(properties.role));
errors.collect(cdk.propertyValidator('role', cdk.validateString)(properties.role));
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_ReplicationRulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "ReplicationConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationConfiguration` resource
*
* @param properties - the TypeScript properties of a `ReplicationConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationConfigurationPropertyValidator(properties).assertSuccess();
return {
Role: cdk.stringToCloudFormation(properties.role),
Rules: cdk.listMapper(cfnBucketReplicationRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.ReplicationConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
role: cfn_parse.FromCloudFormation.getString(properties.Role),
rules: cfn_parse.FromCloudFormation.getArray(properties.Rules, (prop1: any) => CfnBucketReplicationRulePropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html
*/
export interface ReplicationDestinationProperty {
/**
* `CfnBucket.ReplicationDestinationProperty.AccessControlTranslation`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-accesscontroltranslation
*/
readonly accessControlTranslation?: CfnBucket.AccessControlTranslationProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationDestinationProperty.Account`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-account
*/
readonly account?: string;
/**
* `CfnBucket.ReplicationDestinationProperty.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationconfiguration-rules-destination-bucket
*/
readonly bucket: string;
/**
* `CfnBucket.ReplicationDestinationProperty.EncryptionConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-encryptionconfiguration
*/
readonly encryptionConfiguration?: CfnBucket.EncryptionConfigurationProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationDestinationProperty.StorageClass`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationconfiguration-rules-destination-storageclass
*/
readonly storageClass?: string;
}
}
/**
* Determine whether the given properties match those of a `ReplicationDestinationProperty`
*
* @param properties - the TypeScript properties of a `ReplicationDestinationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationDestinationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accessControlTranslation', CfnBucket_AccessControlTranslationPropertyValidator)(properties.accessControlTranslation));
errors.collect(cdk.propertyValidator('account', cdk.validateString)(properties.account));
errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
errors.collect(cdk.propertyValidator('encryptionConfiguration', CfnBucket_EncryptionConfigurationPropertyValidator)(properties.encryptionConfiguration));
errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
return errors.wrap('supplied properties not correct for "ReplicationDestinationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationDestination` resource
*
* @param properties - the TypeScript properties of a `ReplicationDestinationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationDestination` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationDestinationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationDestinationPropertyValidator(properties).assertSuccess();
return {
AccessControlTranslation: cfnBucketAccessControlTranslationPropertyToCloudFormation(properties.accessControlTranslation),
Account: cdk.stringToCloudFormation(properties.account),
Bucket: cdk.stringToCloudFormation(properties.bucket),
EncryptionConfiguration: cfnBucketEncryptionConfigurationPropertyToCloudFormation(properties.encryptionConfiguration),
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationDestinationPropertyFromCloudFormation(properties: any): CfnBucket.ReplicationDestinationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
accessControlTranslation: properties.AccessControlTranslation == null ? undefined : CfnBucketAccessControlTranslationPropertyFromCloudFormation(properties.AccessControlTranslation),
account: properties.Account == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Account),
bucket: cfn_parse.FromCloudFormation.getString(properties.Bucket),
encryptionConfiguration: properties.EncryptionConfiguration == null ? undefined : CfnBucketEncryptionConfigurationPropertyFromCloudFormation(properties.EncryptionConfiguration),
storageClass: properties.StorageClass == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.StorageClass),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html
*/
export interface ReplicationRuleProperty {
/**
* `CfnBucket.ReplicationRuleProperty.Destination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-destination
*/
readonly destination: CfnBucket.ReplicationDestinationProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationRuleProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-id
*/
readonly id?: string;
/**
* `CfnBucket.ReplicationRuleProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-prefix
*/
readonly prefix: string;
/**
* `CfnBucket.ReplicationRuleProperty.SourceSelectionCriteria`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-sourceselectioncriteria
*/
readonly sourceSelectionCriteria?: CfnBucket.SourceSelectionCriteriaProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationRuleProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationconfiguration-rules-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `ReplicationRuleProperty`
*
* @param properties - the TypeScript properties of a `ReplicationRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_ReplicationDestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.requiredValidator)(properties.prefix));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('sourceSelectionCriteria', CfnBucket_SourceSelectionCriteriaPropertyValidator)(properties.sourceSelectionCriteria));
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "ReplicationRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRule` resource
*
* @param properties - the TypeScript properties of a `ReplicationRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationRulePropertyValidator(properties).assertSuccess();
return {
Destination: cfnBucketReplicationDestinationPropertyToCloudFormation(properties.destination),
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
SourceSelectionCriteria: cfnBucketSourceSelectionCriteriaPropertyToCloudFormation(properties.sourceSelectionCriteria),
Status: cdk.stringToCloudFormation(properties.status),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRulePropertyFromCloudFormation(properties: any): CfnBucket.ReplicationRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
destination: CfnBucketReplicationDestinationPropertyFromCloudFormation(properties.Destination),
id: properties.Id == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Id),
prefix: cfn_parse.FromCloudFormation.getString(properties.Prefix),
sourceSelectionCriteria: properties.SourceSelectionCriteria == null ? undefined : CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties.SourceSelectionCriteria),
status: cfn_parse.FromCloudFormation.getString(properties.Status),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html
*/
export interface RoutingRuleProperty {
/**
* `CfnBucket.RoutingRuleProperty.RedirectRule`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-redirectrule
*/
readonly redirectRule: CfnBucket.RedirectRuleProperty | cdk.IResolvable;
/**
* `CfnBucket.RoutingRuleProperty.RoutingRuleCondition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition
*/
readonly routingRuleCondition?: CfnBucket.RoutingRuleConditionProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `RoutingRuleProperty`
*
* @param properties - the TypeScript properties of a `RoutingRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RoutingRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('redirectRule', cdk.requiredValidator)(properties.redirectRule));
errors.collect(cdk.propertyValidator('redirectRule', CfnBucket_RedirectRulePropertyValidator)(properties.redirectRule));
errors.collect(cdk.propertyValidator('routingRuleCondition', CfnBucket_RoutingRuleConditionPropertyValidator)(properties.routingRuleCondition));
return errors.wrap('supplied properties not correct for "RoutingRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRule` resource
*
* @param properties - the TypeScript properties of a `RoutingRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRoutingRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RoutingRulePropertyValidator(properties).assertSuccess();
return {
RedirectRule: cfnBucketRedirectRulePropertyToCloudFormation(properties.redirectRule),
RoutingRuleCondition: cfnBucketRoutingRuleConditionPropertyToCloudFormation(properties.routingRuleCondition),
};
}
// @ts-ignore TS6133
function CfnBucketRoutingRulePropertyFromCloudFormation(properties: any): CfnBucket.RoutingRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
redirectRule: CfnBucketRedirectRulePropertyFromCloudFormation(properties.RedirectRule),
routingRuleCondition: properties.RoutingRuleCondition == null ? undefined : CfnBucketRoutingRuleConditionPropertyFromCloudFormation(properties.RoutingRuleCondition),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html
*/
export interface RoutingRuleConditionProperty {
/**
* `CfnBucket.RoutingRuleConditionProperty.HttpErrorCodeReturnedEquals`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-httperrorcodereturnedequals
*/
readonly httpErrorCodeReturnedEquals?: string;
/**
* `CfnBucket.RoutingRuleConditionProperty.KeyPrefixEquals`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-keyprefixequals
*/
readonly keyPrefixEquals?: string;
}
}
/**
* Determine whether the given properties match those of a `RoutingRuleConditionProperty`
*
* @param properties - the TypeScript properties of a `RoutingRuleConditionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RoutingRuleConditionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('httpErrorCodeReturnedEquals', cdk.validateString)(properties.httpErrorCodeReturnedEquals));
errors.collect(cdk.propertyValidator('keyPrefixEquals', cdk.validateString)(properties.keyPrefixEquals));
return errors.wrap('supplied properties not correct for "RoutingRuleConditionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRuleCondition` resource
*
* @param properties - the TypeScript properties of a `RoutingRuleConditionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRuleCondition` resource.
*/
// @ts-ignore TS6133
function cfnBucketRoutingRuleConditionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RoutingRuleConditionPropertyValidator(properties).assertSuccess();
return {
HttpErrorCodeReturnedEquals: cdk.stringToCloudFormation(properties.httpErrorCodeReturnedEquals),
KeyPrefixEquals: cdk.stringToCloudFormation(properties.keyPrefixEquals),
};
}
// @ts-ignore TS6133
function CfnBucketRoutingRuleConditionPropertyFromCloudFormation(properties: any): CfnBucket.RoutingRuleConditionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
httpErrorCodeReturnedEquals: properties.HttpErrorCodeReturnedEquals == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.HttpErrorCodeReturnedEquals),
keyPrefixEquals: properties.KeyPrefixEquals == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.KeyPrefixEquals),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html
*/
export interface RuleProperty {
/**
* `CfnBucket.RuleProperty.AbortIncompleteMultipartUpload`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-abortincompletemultipartupload
*/
readonly abortIncompleteMultipartUpload?: CfnBucket.AbortIncompleteMultipartUploadProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.ExpirationDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationdate
*/
readonly expirationDate?: Date | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.ExpirationInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationindays
*/
readonly expirationInDays?: number;
/**
* `CfnBucket.RuleProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-id
*/
readonly id?: string;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionExpirationInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversionexpirationindays
*/
readonly noncurrentVersionExpirationInDays?: number;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionTransition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition
*/
readonly noncurrentVersionTransition?: CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionTransitions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransitions
*/
readonly noncurrentVersionTransitions?: Array<CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.RuleProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-status
*/
readonly status: string;
/**
* `CfnBucket.RuleProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Transition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transition
*/
readonly transition?: CfnBucket.TransitionProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Transitions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transitions
*/
readonly transitions?: Array<CfnBucket.TransitionProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `RuleProperty`
*
* @param properties - the TypeScript properties of a `RuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('abortIncompleteMultipartUpload', CfnBucket_AbortIncompleteMultipartUploadPropertyValidator)(properties.abortIncompleteMultipartUpload));
errors.collect(cdk.propertyValidator('expirationDate', cdk.validateDate)(properties.expirationDate));
errors.collect(cdk.propertyValidator('expirationInDays', cdk.validateNumber)(properties.expirationInDays));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('noncurrentVersionExpirationInDays', cdk.validateNumber)(properties.noncurrentVersionExpirationInDays));
errors.collect(cdk.propertyValidator('noncurrentVersionTransition', CfnBucket_NoncurrentVersionTransitionPropertyValidator)(properties.noncurrentVersionTransition));
errors.collect(cdk.propertyValidator('noncurrentVersionTransitions', cdk.listValidator(CfnBucket_NoncurrentVersionTransitionPropertyValidator))(properties.noncurrentVersionTransitions));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
errors.collect(cdk.propertyValidator('transition', CfnBucket_TransitionPropertyValidator)(properties.transition));
errors.collect(cdk.propertyValidator('transitions', cdk.listValidator(CfnBucket_TransitionPropertyValidator))(properties.transitions));
return errors.wrap('supplied properties not correct for "RuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Rule` resource
*
* @param properties - the TypeScript properties of a `RuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Rule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RulePropertyValidator(properties).assertSuccess();
return {
AbortIncompleteMultipartUpload: cfnBucketAbortIncompleteMultipartUploadPropertyToCloudFormation(properties.abortIncompleteMultipartUpload),
ExpirationDate: cdk.dateToCloudFormation(properties.expirationDate),
ExpirationInDays: cdk.numberToCloudFormation(properties.expirationInDays),
Id: cdk.stringToCloudFormation(properties.id),
NoncurrentVersionExpirationInDays: cdk.numberToCloudFormation(properties.noncurrentVersionExpirationInDays),
NoncurrentVersionTransition: cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation(properties.noncurrentVersionTransition),
NoncurrentVersionTransitions: cdk.listMapper(cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation)(properties.noncurrentVersionTransitions),
Prefix: cdk.stringToCloudFormation(properties.prefix),
Status: cdk.stringToCloudFormation(properties.status),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
Transition: cfnBucketTransitionPropertyToCloudFormation(properties.transition),
Transitions: cdk.listMapper(cfnBucketTransitionPropertyToCloudFormation)(properties.transitions),
};
}
// @ts-ignore TS6133
function CfnBucketRulePropertyFromCloudFormation(properties: any): CfnBucket.RuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
abortIncompleteMultipartUpload: properties.AbortIncompleteMultipartUpload == null ? undefined : CfnBucketAbortIncompleteMultipartUploadPropertyFromCloudFormation(properties.AbortIncompleteMultipartUpload),
expirationDate: properties.ExpirationDate == null ? undefined : cfn_parse.FromCloudFormation.getDate(properties.ExpirationDate),
expirationInDays: properties.ExpirationInDays == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.ExpirationInDays),
id: properties.Id == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Id),
noncurrentVersionExpirationInDays: properties.NoncurrentVersionExpirationInDays == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.NoncurrentVersionExpirationInDays),
noncurrentVersionTransition: properties.NoncurrentVersionTransition == null ? undefined : CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(properties.NoncurrentVersionTransition),
noncurrentVersionTransitions: cfn_parse.FromCloudFormation.getArray(properties.NoncurrentVersionTransitions, (prop1: any) => CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(prop1)),
prefix: properties.Prefix == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.Prefix),
status: cfn_parse.FromCloudFormation.getString(properties.Status),
tagFilters: cfn_parse.FromCloudFormation.getArray(properties.TagFilters, (prop1: any) => CfnBucketTagFilterPropertyFromCloudFormation(prop1)),
transition: properties.Transition == null ? undefined : CfnBucketTransitionPropertyFromCloudFormation(properties.Transition),
transitions: cfn_parse.FromCloudFormation.getArray(properties.Transitions, (prop1: any) => CfnBucketTransitionPropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html
*/
export interface S3KeyFilterProperty {
/**
* `CfnBucket.S3KeyFilterProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules
*/
readonly rules: Array<CfnBucket.FilterRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `S3KeyFilterProperty`
*
* @param properties - the TypeScript properties of a `S3KeyFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_S3KeyFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_FilterRulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "S3KeyFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.S3KeyFilter` resource
*
* @param properties - the TypeScript properties of a `S3KeyFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.S3KeyFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketS3KeyFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_S3KeyFilterPropertyValidator(properties).assertSuccess();
return {
Rules: cdk.listMapper(cfnBucketFilterRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketS3KeyFilterPropertyFromCloudFormation(properties: any): CfnBucket.S3KeyFilterProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
rules: cfn_parse.FromCloudFormation.getArray(properties.Rules, (prop1: any) => CfnBucketFilterRulePropertyFromCloudFormation(prop1)),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html
*/
export interface ServerSideEncryptionByDefaultProperty {
/**
* `CfnBucket.ServerSideEncryptionByDefaultProperty.KMSMasterKeyID`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid
*/
readonly kmsMasterKeyId?: string;
/**
* `CfnBucket.ServerSideEncryptionByDefaultProperty.SSEAlgorithm`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm
*/
readonly sseAlgorithm: string;
}
}
/**
* Determine whether the given properties match those of a `ServerSideEncryptionByDefaultProperty`
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionByDefaultProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ServerSideEncryptionByDefaultPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('kmsMasterKeyId', cdk.validateString)(properties.kmsMasterKeyId));
errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.requiredValidator)(properties.sseAlgorithm));
errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.validateString)(properties.sseAlgorithm));
return errors.wrap('supplied properties not correct for "ServerSideEncryptionByDefaultProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionByDefault` resource
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionByDefaultProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionByDefault` resource.
*/
// @ts-ignore TS6133
function cfnBucketServerSideEncryptionByDefaultPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ServerSideEncryptionByDefaultPropertyValidator(properties).assertSuccess();
return {
KMSMasterKeyID: cdk.stringToCloudFormation(properties.kmsMasterKeyId),
SSEAlgorithm: cdk.stringToCloudFormation(properties.sseAlgorithm),
};
}
// @ts-ignore TS6133
function CfnBucketServerSideEncryptionByDefaultPropertyFromCloudFormation(properties: any): CfnBucket.ServerSideEncryptionByDefaultProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
kmsMasterKeyId: properties.KMSMasterKeyID == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.KMSMasterKeyID),
sseAlgorithm: cfn_parse.FromCloudFormation.getString(properties.SSEAlgorithm),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionrule.html
*/
export interface ServerSideEncryptionRuleProperty {
/**
* `CfnBucket.ServerSideEncryptionRuleProperty.ServerSideEncryptionByDefault`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionrule.html#cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault
*/
readonly serverSideEncryptionByDefault?: CfnBucket.ServerSideEncryptionByDefaultProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ServerSideEncryptionRuleProperty`
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ServerSideEncryptionRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('serverSideEncryptionByDefault', CfnBucket_ServerSideEncryptionByDefaultPropertyValidator)(properties.serverSideEncryptionByDefault));
return errors.wrap('supplied properties not correct for "ServerSideEncryptionRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionRule` resource
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketServerSideEncryptionRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ServerSideEncryptionRulePropertyValidator(properties).assertSuccess();
return {
ServerSideEncryptionByDefault: cfnBucketServerSideEncryptionByDefaultPropertyToCloudFormation(properties.serverSideEncryptionByDefault),
};
}
// @ts-ignore TS6133
function CfnBucketServerSideEncryptionRulePropertyFromCloudFormation(properties: any): CfnBucket.ServerSideEncryptionRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
serverSideEncryptionByDefault: properties.ServerSideEncryptionByDefault == null ? undefined : CfnBucketServerSideEncryptionByDefaultPropertyFromCloudFormation(properties.ServerSideEncryptionByDefault),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-sourceselectioncriteria.html
*/
export interface SourceSelectionCriteriaProperty {
/**
* `CfnBucket.SourceSelectionCriteriaProperty.SseKmsEncryptedObjects`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-sourceselectioncriteria.html#cfn-s3-bucket-sourceselectioncriteria-ssekmsencryptedobjects
*/
readonly sseKmsEncryptedObjects: CfnBucket.SseKmsEncryptedObjectsProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `SourceSelectionCriteriaProperty`
*
* @param properties - the TypeScript properties of a `SourceSelectionCriteriaProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_SourceSelectionCriteriaPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('sseKmsEncryptedObjects', cdk.requiredValidator)(properties.sseKmsEncryptedObjects));
errors.collect(cdk.propertyValidator('sseKmsEncryptedObjects', CfnBucket_SseKmsEncryptedObjectsPropertyValidator)(properties.sseKmsEncryptedObjects));
return errors.wrap('supplied properties not correct for "SourceSelectionCriteriaProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.SourceSelectionCriteria` resource
*
* @param properties - the TypeScript properties of a `SourceSelectionCriteriaProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.SourceSelectionCriteria` resource.
*/
// @ts-ignore TS6133
function cfnBucketSourceSelectionCriteriaPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_SourceSelectionCriteriaPropertyValidator(properties).assertSuccess();
return {
SseKmsEncryptedObjects: cfnBucketSseKmsEncryptedObjectsPropertyToCloudFormation(properties.sseKmsEncryptedObjects),
};
}
// @ts-ignore TS6133
function CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties: any): CfnBucket.SourceSelectionCriteriaProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
sseKmsEncryptedObjects: CfnBucketSseKmsEncryptedObjectsPropertyFromCloudFormation(properties.SseKmsEncryptedObjects),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html
*/
export interface SseKmsEncryptedObjectsProperty {
/**
* `CfnBucket.SseKmsEncryptedObjectsProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html#cfn-s3-bucket-ssekmsencryptedobjects-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `SseKmsEncryptedObjectsProperty`
*
* @param properties - the TypeScript properties of a `SseKmsEncryptedObjectsProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_SseKmsEncryptedObjectsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "SseKmsEncryptedObjectsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.SseKmsEncryptedObjects` resource
*
* @param properties - the TypeScript properties of a `SseKmsEncryptedObjectsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.SseKmsEncryptedObjects` resource.
*/
// @ts-ignore TS6133
function cfnBucketSseKmsEncryptedObjectsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_SseKmsEncryptedObjectsPropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
};
}
// @ts-ignore TS6133
function CfnBucketSseKmsEncryptedObjectsPropertyFromCloudFormation(properties: any): CfnBucket.SseKmsEncryptedObjectsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
status: cfn_parse.FromCloudFormation.getString(properties.Status),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-storageclassanalysis.html
*/
export interface StorageClassAnalysisProperty {
/**
* `CfnBucket.StorageClassAnalysisProperty.DataExport`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-storageclassanalysis.html#cfn-s3-bucket-storageclassanalysis-dataexport
*/
readonly dataExport?: CfnBucket.DataExportProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `StorageClassAnalysisProperty`
*
* @param properties - the TypeScript properties of a `StorageClassAnalysisProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_StorageClassAnalysisPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('dataExport', CfnBucket_DataExportPropertyValidator)(properties.dataExport));
return errors.wrap('supplied properties not correct for "StorageClassAnalysisProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.StorageClassAnalysis` resource
*
* @param properties - the TypeScript properties of a `StorageClassAnalysisProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.StorageClassAnalysis` resource.
*/
// @ts-ignore TS6133
function cfnBucketStorageClassAnalysisPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_StorageClassAnalysisPropertyValidator(properties).assertSuccess();
return {
DataExport: cfnBucketDataExportPropertyToCloudFormation(properties.dataExport),
};
}
// @ts-ignore TS6133
function CfnBucketStorageClassAnalysisPropertyFromCloudFormation(properties: any): CfnBucket.StorageClassAnalysisProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
dataExport: properties.DataExport == null ? undefined : CfnBucketDataExportPropertyFromCloudFormation(properties.DataExport),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html
*/
export interface TagFilterProperty {
/**
* `CfnBucket.TagFilterProperty.Key`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key
*/
readonly key: string;
/**
* `CfnBucket.TagFilterProperty.Value`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value
*/
readonly value: string;
}
}
/**
* Determine whether the given properties match those of a `TagFilterProperty`
*
* @param properties - the TypeScript properties of a `TagFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TagFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key));
errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key));
errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
return errors.wrap('supplied properties not correct for "TagFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.TagFilter` resource
*
* @param properties - the TypeScript properties of a `TagFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.TagFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketTagFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TagFilterPropertyValidator(properties).assertSuccess();
return {
Key: cdk.stringToCloudFormation(properties.key),
Value: cdk.stringToCloudFormation(properties.value),
};
}
// @ts-ignore TS6133
function CfnBucketTagFilterPropertyFromCloudFormation(properties: any): CfnBucket.TagFilterProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
key: cfn_parse.FromCloudFormation.getString(properties.Key),
value: cfn_parse.FromCloudFormation.getString(properties.Value),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html
*/
export interface TopicConfigurationProperty {
/**
* `CfnBucket.TopicConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-event
*/
readonly event: string;
/**
* `CfnBucket.TopicConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.TopicConfigurationProperty.Topic`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-topic
*/
readonly topic: string;
}
}
/**
* Determine whether the given properties match those of a `TopicConfigurationProperty`
*
* @param properties - the TypeScript properties of a `TopicConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TopicConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('topic', cdk.requiredValidator)(properties.topic));
errors.collect(cdk.propertyValidator('topic', cdk.validateString)(properties.topic));
return errors.wrap('supplied properties not correct for "TopicConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.TopicConfiguration` resource
*
* @param properties - the TypeScript properties of a `TopicConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.TopicConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketTopicConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TopicConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Topic: cdk.stringToCloudFormation(properties.topic),
};
}
// @ts-ignore TS6133
function CfnBucketTopicConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.TopicConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
event: cfn_parse.FromCloudFormation.getString(properties.Event),
filter: properties.Filter == null ? undefined : CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter),
topic: cfn_parse.FromCloudFormation.getString(properties.Topic),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html
*/
export interface TransitionProperty {
/**
* `CfnBucket.TransitionProperty.StorageClass`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-storageclass
*/
readonly storageClass: string;
/**
* `CfnBucket.TransitionProperty.TransitionDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitiondate
*/
readonly transitionDate?: Date | cdk.IResolvable;
/**
* `CfnBucket.TransitionProperty.TransitionInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitionindays
*/
readonly transitionInDays?: number;
}
}
/**
* Determine whether the given properties match those of a `TransitionProperty`
*
* @param properties - the TypeScript properties of a `TransitionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TransitionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
errors.collect(cdk.propertyValidator('transitionDate', cdk.validateDate)(properties.transitionDate));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
return errors.wrap('supplied properties not correct for "TransitionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Transition` resource
*
* @param properties - the TypeScript properties of a `TransitionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Transition` resource.
*/
// @ts-ignore TS6133
function cfnBucketTransitionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TransitionPropertyValidator(properties).assertSuccess();
return {
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
TransitionDate: cdk.dateToCloudFormation(properties.transitionDate),
TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
};
}
// @ts-ignore TS6133
function CfnBucketTransitionPropertyFromCloudFormation(properties: any): CfnBucket.TransitionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
storageClass: cfn_parse.FromCloudFormation.getString(properties.StorageClass),
transitionDate: properties.TransitionDate == null ? undefined : cfn_parse.FromCloudFormation.getDate(properties.TransitionDate),
transitionInDays: properties.TransitionInDays == null ? undefined : cfn_parse.FromCloudFormation.getNumber(properties.TransitionInDays),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-versioningconfig.html
*/
export interface VersioningConfigurationProperty {
/**
* `CfnBucket.VersioningConfigurationProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-versioningconfig.html#cfn-s3-bucket-versioningconfig-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `VersioningConfigurationProperty`
*
* @param properties - the TypeScript properties of a `VersioningConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_VersioningConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "VersioningConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.VersioningConfiguration` resource
*
* @param properties - the TypeScript properties of a `VersioningConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.VersioningConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketVersioningConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_VersioningConfigurationPropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
};
}
// @ts-ignore TS6133
function CfnBucketVersioningConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.VersioningConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
status: cfn_parse.FromCloudFormation.getString(properties.Status),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html
*/
export interface WebsiteConfigurationProperty {
/**
* `CfnBucket.WebsiteConfigurationProperty.ErrorDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-errordocument
*/
readonly errorDocument?: string;
/**
* `CfnBucket.WebsiteConfigurationProperty.IndexDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-indexdocument
*/
readonly indexDocument?: string;
/**
* `CfnBucket.WebsiteConfigurationProperty.RedirectAllRequestsTo`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-redirectallrequeststo
*/
readonly redirectAllRequestsTo?: CfnBucket.RedirectAllRequestsToProperty | cdk.IResolvable;
/**
* `CfnBucket.WebsiteConfigurationProperty.RoutingRules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-routingrules
*/
readonly routingRules?: Array<CfnBucket.RoutingRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `WebsiteConfigurationProperty`
*
* @param properties - the TypeScript properties of a `WebsiteConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_WebsiteConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('errorDocument', cdk.validateString)(properties.errorDocument));
errors.collect(cdk.propertyValidator('indexDocument', cdk.validateString)(properties.indexDocument));
errors.collect(cdk.propertyValidator('redirectAllRequestsTo', CfnBucket_RedirectAllRequestsToPropertyValidator)(properties.redirectAllRequestsTo));
errors.collect(cdk.propertyValidator('routingRules', cdk.listValidator(CfnBucket_RoutingRulePropertyValidator))(properties.routingRules));
return errors.wrap('supplied properties not correct for "WebsiteConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.WebsiteConfiguration` resource
*
* @param properties - the TypeScript properties of a `WebsiteConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.WebsiteConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketWebsiteConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_WebsiteConfigurationPropertyValidator(properties).assertSuccess();
return {
ErrorDocument: cdk.stringToCloudFormation(properties.errorDocument),
IndexDocument: cdk.stringToCloudFormation(properties.indexDocument),
RedirectAllRequestsTo: cfnBucketRedirectAllRequestsToPropertyToCloudFormation(properties.redirectAllRequestsTo),
RoutingRules: cdk.listMapper(cfnBucketRoutingRulePropertyToCloudFormation)(properties.routingRules),
};
}
// @ts-ignore TS6133
function CfnBucketWebsiteConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.WebsiteConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
errorDocument: properties.ErrorDocument == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.ErrorDocument),
indexDocument: properties.IndexDocument == null ? undefined : cfn_parse.FromCloudFormation.getString(properties.IndexDocument),
redirectAllRequestsTo: properties.RedirectAllRequestsTo == null ? undefined : CfnBucketRedirectAllRequestsToPropertyFromCloudFormation(properties.RedirectAllRequestsTo),
routingRules: cfn_parse.FromCloudFormation.getArray(properties.RoutingRules, (prop1: any) => CfnBucketRoutingRulePropertyFromCloudFormation(prop1)),
};
}
/**
* Properties for defining a `AWS::S3::BucketPolicy`
*
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html
*/
export interface CfnBucketPolicyProps {
/**
* `AWS::S3::BucketPolicy.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-bucket
*/
readonly bucket: string;
/**
* `AWS::S3::BucketPolicy.PolicyDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-policydocument
*/
readonly policyDocument: any | cdk.IResolvable;
}
/**
* Determine whether the given properties match those of a `CfnBucketPolicyProps`
*
* @param properties - the TypeScript properties of a `CfnBucketPolicyProps`
*
* @returns the result of the validation.
*/
function CfnBucketPolicyPropsValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
return errors.wrap('supplied properties not correct for "CfnBucketPolicyProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::BucketPolicy` resource
*
* @param properties - the TypeScript properties of a `CfnBucketPolicyProps`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::BucketPolicy` resource.
*/
// @ts-ignore TS6133
function cfnBucketPolicyPropsToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucketPolicyPropsValidator(properties).assertSuccess();
return {
Bucket: cdk.stringToCloudFormation(properties.bucket),
PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
};
}
// @ts-ignore TS6133
function CfnBucketPolicyPropsFromCloudFormation(properties: any): CfnBucketPolicyProps {
properties = properties || {};
return {
bucket: cfn_parse.FromCloudFormation.getString(properties.Bucket),
policyDocument: cfn_parse.FromCloudFormation.getAny(properties.PolicyDocument),
};
}
/**
* A CloudFormation `AWS::S3::BucketPolicy`
*
* @cloudformationResource AWS::S3::BucketPolicy
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html
*/
export class CfnBucketPolicy extends cdk.CfnResource implements cdk.IInspectable {
/**
* The CloudFormation resource type name for this resource class.
*/
public static readonly CFN_RESOURCE_TYPE_NAME = "AWS::S3::BucketPolicy";
/**
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @experimental
*/
public static fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, finder: cdk.ICfnFinder): CfnBucketPolicy {
resourceAttributes = resourceAttributes || {};
const resourceProperties = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Properties);
const props = CfnBucketPolicyPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucketPolicy(scope, id, props);
const cfnOptions = ret.cfnOptions;
cfnOptions.deletionPolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.DeletionPolicy);
cfnOptions.updateReplacePolicy = cfn_parse.FromCloudFormation.parseDeletionPolicy(resourceAttributes.UpdateReplacePolicy);
cfnOptions.metadata = cfn_parse.FromCloudFormation.parseValue(resourceAttributes.Metadata);
// handle DependsOn
resourceAttributes.DependsOn = resourceAttributes.DependsOn ?? [];
const dependencies: string[] = Array.isArray(resourceAttributes.DependsOn) ? resourceAttributes.DependsOn : [resourceAttributes.DependsOn];
for (const dep of dependencies) {
const depResource = finder.findResource(dep);
if (!depResource) {
throw new Error(`Resource '${id}' depends on '${dep}' that doesn't exist`);
}
ret.node.addDependency(depResource);
}
return ret;
}
/**
* `AWS::S3::BucketPolicy.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-bucket
*/
public bucket: string;
/**
* `AWS::S3::BucketPolicy.PolicyDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-policydocument
*/
public policyDocument: any | cdk.IResolvable;
/**
* Create a new `AWS::S3::BucketPolicy`.
*
* @param scope - scope in which this resource is defined
* @param id - scoped id of the resource
* @param props - resource properties
*/
constructor(scope: cdk.Construct, id: string, props: CfnBucketPolicyProps) {
super(scope, id, { type: CfnBucketPolicy.CFN_RESOURCE_TYPE_NAME, properties: props });
cdk.requireProperty(props, 'bucket', this);
cdk.requireProperty(props, 'policyDocument', this);
this.bucket = props.bucket;
this.policyDocument = props.policyDocument;
}
/**
* Examines the CloudFormation resource and discloses attributes.
*
* @param inspector - tree inspector to collect and process attributes
*
* @stability experimental
*/
public inspect(inspector: cdk.TreeInspector) {
inspector.addAttribute("aws:cdk:cloudformation:type", CfnBucketPolicy.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
protected get cfnProperties(): { [key: string]: any } {
return {
bucket: this.bucket,
policyDocument: this.policyDocument,
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnBucketPolicyPropsToCloudFormation(props);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment