Skip to content

Instantly share code, notes, and snippets.

@skinny85
Created December 2, 2020 04:47
Show Gist options
  • Save skinny85/b892306a9b027fc8738395a0dfcee4d6 to your computer and use it in GitHub Desktop.
Save skinny85/b892306a9b027fc8738395a0dfcee4d6 to your computer and use it in GitHub Desktop.
// 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-12-02T02:01:04.788Z","fingerprint":"eifpSUbhYvlpfsD4HbA3E49WhtntsXdbjFh+lXzeO9U="}
/* eslint-disable max-len */ // 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),
...cfn_parse.FromCloudFormation.omit(properties, 'bucket', 'creationDate', 'name', 'networkOrigin', 'policy', 'policyStatus', 'publicAccessBlockConfiguration', 'vpcConfiguration'),
};
}
// @ts-ignore TS6133
function CfnAccessPointPropsFromCloudFormation(properties: any): CfnAccessPointProps {
properties = properties || {};
return {
bucket: cfn_parse.FromCloudFormation.getString(properties.Bucket),
creationDate: properties.CreationDate != null ? cfn_parse.FromCloudFormation.getString(properties.CreationDate) : undefined,
name: properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined,
networkOrigin: properties.NetworkOrigin != null ? cfn_parse.FromCloudFormation.getString(properties.NetworkOrigin) : undefined,
policy: properties.Policy != null ? cfn_parse.FromCloudFormation.getAny(properties.Policy) : undefined,
policyStatus: properties.PolicyStatus != null ? cfn_parse.FromCloudFormation.getAny(properties.PolicyStatus) : undefined,
publicAccessBlockConfiguration: properties.PublicAccessBlockConfiguration != null ? CfnAccessPointPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration) : undefined,
vpcConfiguration: properties.VpcConfiguration != null ? CfnAccessPointVpcConfigurationPropertyFromCloudFormation(properties.VpcConfiguration) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Bucket', 'CreationDate', 'Name', 'NetworkOrigin', 'Policy', 'PolicyStatus', 'PublicAccessBlockConfiguration', '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.
*
* @internal
*/
public static _fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnAccessPoint {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const props = CfnAccessPointPropsFromCloudFormation(resourceProperties);
const ret = new CfnAccessPoint(scope, id, props);
options.parser.handleAttributes(ret, resourceAttributes, id);
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,
...cfn_parse.FromCloudFormation.omit(this._cfnProperties, 'bucket', 'creationDate', 'name', 'networkOrigin', 'policy', 'policyStatus', 'publicAccessBlockConfiguration', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'blockPublicAcls', 'blockPublicPolicy', 'ignorePublicAcls', '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 ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls) : undefined,
blockPublicPolicy: properties.BlockPublicPolicy != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy) : undefined,
ignorePublicAcls: properties.IgnorePublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls) : undefined,
restrictPublicBuckets: properties.RestrictPublicBuckets != null ? cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', '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),
...cfn_parse.FromCloudFormation.omit(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 ? cfn_parse.FromCloudFormation.getString(properties.VpcId) : undefined,
...cfn_parse.FromCloudFormation.omit(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.IntelligentTieringConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-intelligenttieringconfigurations
*/
readonly intelligentTieringConfigurations?: Array<CfnBucket.IntelligentTieringConfigurationProperty | cdk.IResolvable> | 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.OwnershipControls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-ownershipcontrols
*/
readonly ownershipControls?: CfnBucket.OwnershipControlsProperty | 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('intelligentTieringConfigurations', cdk.listValidator(CfnBucket_IntelligentTieringConfigurationPropertyValidator))(properties.intelligentTieringConfigurations));
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('ownershipControls', CfnBucket_OwnershipControlsPropertyValidator)(properties.ownershipControls));
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),
IntelligentTieringConfigurations: cdk.listMapper(cfnBucketIntelligentTieringConfigurationPropertyToCloudFormation)(properties.intelligentTieringConfigurations),
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),
OwnershipControls: cfnBucketOwnershipControlsPropertyToCloudFormation(properties.ownershipControls),
PublicAccessBlockConfiguration: cfnBucketPublicAccessBlockConfigurationPropertyToCloudFormation(properties.publicAccessBlockConfiguration),
ReplicationConfiguration: cfnBucketReplicationConfigurationPropertyToCloudFormation(properties.replicationConfiguration),
Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags),
VersioningConfiguration: cfnBucketVersioningConfigurationPropertyToCloudFormation(properties.versioningConfiguration),
WebsiteConfiguration: cfnBucketWebsiteConfigurationPropertyToCloudFormation(properties.websiteConfiguration),
...cfn_parse.FromCloudFormation.omit(properties, 'accelerateConfiguration', 'accessControl', 'analyticsConfigurations', 'bucketEncryption', 'bucketName', 'corsConfiguration', 'intelligentTieringConfigurations', 'inventoryConfigurations', 'lifecycleConfiguration', 'loggingConfiguration', 'metricsConfigurations', 'notificationConfiguration', 'objectLockConfiguration', 'objectLockEnabled', 'ownershipControls', 'publicAccessBlockConfiguration', 'replicationConfiguration', 'tags', 'versioningConfiguration', 'websiteConfiguration'),
};
}
// @ts-ignore TS6133
function CfnBucketPropsFromCloudFormation(properties: any): CfnBucketProps {
properties = properties || {};
return {
accelerateConfiguration: properties.AccelerateConfiguration != null ? CfnBucketAccelerateConfigurationPropertyFromCloudFormation(properties.AccelerateConfiguration) : undefined,
accessControl: properties.AccessControl != null ? cfn_parse.FromCloudFormation.getString(properties.AccessControl) : undefined,
analyticsConfigurations: properties.AnalyticsConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketAnalyticsConfigurationPropertyFromCloudFormation)(properties.AnalyticsConfigurations) : undefined,
bucketEncryption: properties.BucketEncryption != null ? CfnBucketBucketEncryptionPropertyFromCloudFormation(properties.BucketEncryption) : undefined,
bucketName: properties.BucketName != null ? cfn_parse.FromCloudFormation.getString(properties.BucketName) : undefined,
corsConfiguration: properties.CorsConfiguration != null ? CfnBucketCorsConfigurationPropertyFromCloudFormation(properties.CorsConfiguration) : undefined,
intelligentTieringConfigurations: properties.IntelligentTieringConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketIntelligentTieringConfigurationPropertyFromCloudFormation)(properties.IntelligentTieringConfigurations) : undefined,
inventoryConfigurations: properties.InventoryConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketInventoryConfigurationPropertyFromCloudFormation)(properties.InventoryConfigurations) : undefined,
lifecycleConfiguration: properties.LifecycleConfiguration != null ? CfnBucketLifecycleConfigurationPropertyFromCloudFormation(properties.LifecycleConfiguration) : undefined,
loggingConfiguration: properties.LoggingConfiguration != null ? CfnBucketLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration) : undefined,
metricsConfigurations: properties.MetricsConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketMetricsConfigurationPropertyFromCloudFormation)(properties.MetricsConfigurations) : undefined,
notificationConfiguration: properties.NotificationConfiguration != null ? CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties.NotificationConfiguration) : undefined,
objectLockConfiguration: properties.ObjectLockConfiguration != null ? CfnBucketObjectLockConfigurationPropertyFromCloudFormation(properties.ObjectLockConfiguration) : undefined,
objectLockEnabled: properties.ObjectLockEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.ObjectLockEnabled) : undefined,
ownershipControls: properties.OwnershipControls != null ? CfnBucketOwnershipControlsPropertyFromCloudFormation(properties.OwnershipControls) : undefined,
publicAccessBlockConfiguration: properties.PublicAccessBlockConfiguration != null ? CfnBucketPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration) : undefined,
replicationConfiguration: properties.ReplicationConfiguration != null ? CfnBucketReplicationConfigurationPropertyFromCloudFormation(properties.ReplicationConfiguration) : undefined,
tags: properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined as any,
versioningConfiguration: properties.VersioningConfiguration != null ? CfnBucketVersioningConfigurationPropertyFromCloudFormation(properties.VersioningConfiguration) : undefined,
websiteConfiguration: properties.WebsiteConfiguration != null ? CfnBucketWebsiteConfigurationPropertyFromCloudFormation(properties.WebsiteConfiguration) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AccelerateConfiguration', 'AccessControl', 'AnalyticsConfigurations', 'BucketEncryption', 'BucketName', 'CorsConfiguration', 'IntelligentTieringConfigurations', 'InventoryConfigurations', 'LifecycleConfiguration', 'LoggingConfiguration', 'MetricsConfigurations', 'NotificationConfiguration', 'ObjectLockConfiguration', 'ObjectLockEnabled', 'OwnershipControls', 'PublicAccessBlockConfiguration', 'ReplicationConfiguration', 'Tags', 'VersioningConfiguration', '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.
*
* @internal
*/
public static _fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnBucket {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const props = CfnBucketPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucket(scope, id, props);
options.parser.handleAttributes(ret, resourceAttributes, id);
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.IntelligentTieringConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-intelligenttieringconfigurations
*/
public intelligentTieringConfigurations: Array<CfnBucket.IntelligentTieringConfigurationProperty | cdk.IResolvable> | 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.OwnershipControls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-ownershipcontrols
*/
public ownershipControls: CfnBucket.OwnershipControlsProperty | 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.intelligentTieringConfigurations = props.intelligentTieringConfigurations;
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.ownershipControls = props.ownershipControls;
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,
intelligentTieringConfigurations: this.intelligentTieringConfigurations,
inventoryConfigurations: this.inventoryConfigurations,
lifecycleConfiguration: this.lifecycleConfiguration,
loggingConfiguration: this.loggingConfiguration,
metricsConfigurations: this.metricsConfigurations,
notificationConfiguration: this.notificationConfiguration,
objectLockConfiguration: this.objectLockConfiguration,
objectLockEnabled: this.objectLockEnabled,
ownershipControls: this.ownershipControls,
publicAccessBlockConfiguration: this.publicAccessBlockConfiguration,
replicationConfiguration: this.replicationConfiguration,
tags: this.tags.renderTags(),
versioningConfiguration: this.versioningConfiguration,
websiteConfiguration: this.websiteConfiguration,
...cfn_parse.FromCloudFormation.omit(this._cfnProperties, 'accelerateConfiguration', 'accessControl', 'analyticsConfigurations', 'bucketEncryption', 'bucketName', 'corsConfiguration', 'intelligentTieringConfigurations', 'inventoryConfigurations', 'lifecycleConfiguration', 'loggingConfiguration', 'metricsConfigurations', 'notificationConfiguration', 'objectLockConfiguration', 'objectLockEnabled', 'ownershipControls', 'publicAccessBlockConfiguration', 'replicationConfiguration', 'tags', 'versioningConfiguration', '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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(properties, 'id', 'prefix', 'storageClassAnalysis', '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 ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
storageClassAnalysis: CfnBucketStorageClassAnalysisPropertyFromCloudFormation(properties.StorageClassAnalysis),
tagFilters: properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'StorageClassAnalysis', 'TagFilters'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(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(CfnBucketServerSideEncryptionRulePropertyFromCloudFormation)(properties.ServerSideEncryptionConfiguration),
...cfn_parse.FromCloudFormation.omit(properties, 'ServerSideEncryptionConfiguration'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(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(CfnBucketCorsRulePropertyFromCloudFormation)(properties.CorsRules),
...cfn_parse.FromCloudFormation.omit(properties, 'CorsRules'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'allowedHeaders', 'allowedMethods', 'allowedOrigins', 'exposedHeaders', 'id', 'maxAge'),
};
}
// @ts-ignore TS6133
function CfnBucketCorsRulePropertyFromCloudFormation(properties: any): CfnBucket.CorsRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
allowedHeaders: properties.AllowedHeaders != null ? cfn_parse.FromCloudFormation.getStringArray(properties.AllowedHeaders) : undefined,
allowedMethods: cfn_parse.FromCloudFormation.getStringArray(properties.AllowedMethods),
allowedOrigins: cfn_parse.FromCloudFormation.getStringArray(properties.AllowedOrigins),
exposedHeaders: properties.ExposedHeaders != null ? cfn_parse.FromCloudFormation.getStringArray(properties.ExposedHeaders) : undefined,
id: properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined,
maxAge: properties.MaxAge != null ? cfn_parse.FromCloudFormation.getNumber(properties.MaxAge) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AllowedHeaders', 'AllowedMethods', 'AllowedOrigins', 'ExposedHeaders', 'Id', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'destination', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'Destination', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'days', 'mode', '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 ? cfn_parse.FromCloudFormation.getNumber(properties.Days) : undefined,
mode: properties.Mode != null ? cfn_parse.FromCloudFormation.getString(properties.Mode) : undefined,
years: properties.Years != null ? cfn_parse.FromCloudFormation.getNumber(properties.Years) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Days', 'Mode', 'Years'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-deletemarkerreplication.html
*/
export interface DeleteMarkerReplicationProperty {
/**
* `CfnBucket.DeleteMarkerReplicationProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-deletemarkerreplication.html#cfn-s3-bucket-deletemarkerreplication-status
*/
readonly status?: string;
}
}
/**
* Determine whether the given properties match those of a `DeleteMarkerReplicationProperty`
*
* @param properties - the TypeScript properties of a `DeleteMarkerReplicationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DeleteMarkerReplicationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "DeleteMarkerReplicationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.DeleteMarkerReplication` resource
*
* @param properties - the TypeScript properties of a `DeleteMarkerReplicationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.DeleteMarkerReplication` resource.
*/
// @ts-ignore TS6133
function cfnBucketDeleteMarkerReplicationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DeleteMarkerReplicationPropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
...cfn_parse.FromCloudFormation.omit(properties, 'status'),
};
}
// @ts-ignore TS6133
function CfnBucketDeleteMarkerReplicationPropertyFromCloudFormation(properties: any): CfnBucket.DeleteMarkerReplicationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
status: properties.Status != null ? cfn_parse.FromCloudFormation.getString(properties.Status) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Status'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'bucketAccountId', 'bucketArn', 'format', '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 ? cfn_parse.FromCloudFormation.getString(properties.BucketAccountId) : undefined,
bucketArn: cfn_parse.FromCloudFormation.getString(properties.BucketArn),
format: cfn_parse.FromCloudFormation.getString(properties.Format),
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'BucketAccountId', 'BucketArn', 'Format', '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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(properties, 'name', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'Name', 'Value'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html
*/
export interface IntelligentTieringConfigurationProperty {
/**
* `CfnBucket.IntelligentTieringConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.IntelligentTieringConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.IntelligentTieringConfigurationProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-status
*/
readonly status: string;
/**
* `CfnBucket.IntelligentTieringConfigurationProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.IntelligentTieringConfigurationProperty.Tierings`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-intelligenttieringconfiguration.html#cfn-s3-bucket-intelligenttieringconfiguration-tierings
*/
readonly tierings: Array<CfnBucket.TieringProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `IntelligentTieringConfigurationProperty`
*
* @param properties - the TypeScript properties of a `IntelligentTieringConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_IntelligentTieringConfigurationPropertyValidator(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('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('tierings', cdk.requiredValidator)(properties.tierings));
errors.collect(cdk.propertyValidator('tierings', cdk.listValidator(CfnBucket_TieringPropertyValidator))(properties.tierings));
return errors.wrap('supplied properties not correct for "IntelligentTieringConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.IntelligentTieringConfiguration` resource
*
* @param properties - the TypeScript properties of a `IntelligentTieringConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.IntelligentTieringConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketIntelligentTieringConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_IntelligentTieringConfigurationPropertyValidator(properties).assertSuccess();
return {
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
Status: cdk.stringToCloudFormation(properties.status),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
Tierings: cdk.listMapper(cfnBucketTieringPropertyToCloudFormation)(properties.tierings),
...cfn_parse.FromCloudFormation.omit(properties, 'id', 'prefix', 'status', 'tagFilters', 'tierings'),
};
}
// @ts-ignore TS6133
function CfnBucketIntelligentTieringConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.IntelligentTieringConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
id: cfn_parse.FromCloudFormation.getString(properties.Id),
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
status: cfn_parse.FromCloudFormation.getString(properties.Status),
tagFilters: properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined,
tierings: cfn_parse.FromCloudFormation.getArray(CfnBucketTieringPropertyFromCloudFormation)(properties.Tierings),
...cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'Status', 'TagFilters', 'Tierings'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'destination', 'enabled', 'id', 'includedObjectVersions', 'optionalFields', 'prefix', '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: properties.OptionalFields != null ? cfn_parse.FromCloudFormation.getStringArray(properties.OptionalFields) : undefined,
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
scheduleFrequency: cfn_parse.FromCloudFormation.getString(properties.ScheduleFrequency),
...cfn_parse.FromCloudFormation.omit(properties, 'Destination', 'Enabled', 'Id', 'IncludedObjectVersions', 'OptionalFields', 'Prefix', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'event', 'filter', '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 ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined,
function: cfn_parse.FromCloudFormation.getString(properties.Function),
...cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', '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),
...cfn_parse.FromCloudFormation.omit(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(CfnBucketRulePropertyFromCloudFormation)(properties.Rules),
...cfn_parse.FromCloudFormation.omit(properties, 'Rules'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'destinationBucketName', '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 ? cfn_parse.FromCloudFormation.getString(properties.DestinationBucketName) : undefined,
logFilePrefix: properties.LogFilePrefix != null ? cfn_parse.FromCloudFormation.getString(properties.LogFilePrefix) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'DestinationBucketName', 'LogFilePrefix'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html
*/
export interface MetricsProperty {
/**
* `CfnBucket.MetricsProperty.EventThreshold`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-eventthreshold
*/
readonly eventThreshold?: CfnBucket.ReplicationTimeValueProperty | cdk.IResolvable;
/**
* `CfnBucket.MetricsProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metrics.html#cfn-s3-bucket-metrics-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `MetricsProperty`
*
* @param properties - the TypeScript properties of a `MetricsProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_MetricsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('eventThreshold', CfnBucket_ReplicationTimeValuePropertyValidator)(properties.eventThreshold));
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 "MetricsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Metrics` resource
*
* @param properties - the TypeScript properties of a `MetricsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Metrics` resource.
*/
// @ts-ignore TS6133
function cfnBucketMetricsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_MetricsPropertyValidator(properties).assertSuccess();
return {
EventThreshold: cfnBucketReplicationTimeValuePropertyToCloudFormation(properties.eventThreshold),
Status: cdk.stringToCloudFormation(properties.status),
...cfn_parse.FromCloudFormation.omit(properties, 'eventThreshold', 'status'),
};
}
// @ts-ignore TS6133
function CfnBucketMetricsPropertyFromCloudFormation(properties: any): CfnBucket.MetricsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
eventThreshold: properties.EventThreshold != null ? CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties.EventThreshold) : undefined,
status: cfn_parse.FromCloudFormation.getString(properties.Status),
...cfn_parse.FromCloudFormation.omit(properties, 'EventThreshold', 'Status'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'id', 'prefix', '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 ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
tagFilters: properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'TagFilters'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'storageClass', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'StorageClass', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'lambdaConfigurations', 'queueConfigurations', 'topicConfigurations'),
};
}
// @ts-ignore TS6133
function CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties: any): CfnBucket.NotificationConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
lambdaConfigurations: properties.LambdaConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketLambdaConfigurationPropertyFromCloudFormation)(properties.LambdaConfigurations) : undefined,
queueConfigurations: properties.QueueConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketQueueConfigurationPropertyFromCloudFormation)(properties.QueueConfigurations) : undefined,
topicConfigurations: properties.TopicConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTopicConfigurationPropertyFromCloudFormation)(properties.TopicConfigurations) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'LambdaConfigurations', 'QueueConfigurations', 'TopicConfigurations'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(properties, 'objectLockEnabled', '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 ? cfn_parse.FromCloudFormation.getString(properties.ObjectLockEnabled) : undefined,
rule: properties.Rule != null ? CfnBucketObjectLockRulePropertyFromCloudFormation(properties.Rule) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'ObjectLockEnabled', '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),
...cfn_parse.FromCloudFormation.omit(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 ? CfnBucketDefaultRetentionPropertyFromCloudFormation(properties.DefaultRetention) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'DefaultRetention'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html
*/
export interface OwnershipControlsProperty {
/**
* `CfnBucket.OwnershipControlsProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrols.html#cfn-s3-bucket-ownershipcontrols-rules
*/
readonly rules: Array<CfnBucket.OwnershipControlsRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `OwnershipControlsProperty`
*
* @param properties - the TypeScript properties of a `OwnershipControlsProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_OwnershipControlsPropertyValidator(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_OwnershipControlsRulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "OwnershipControlsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.OwnershipControls` resource
*
* @param properties - the TypeScript properties of a `OwnershipControlsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.OwnershipControls` resource.
*/
// @ts-ignore TS6133
function cfnBucketOwnershipControlsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_OwnershipControlsPropertyValidator(properties).assertSuccess();
return {
Rules: cdk.listMapper(cfnBucketOwnershipControlsRulePropertyToCloudFormation)(properties.rules),
...cfn_parse.FromCloudFormation.omit(properties, 'rules'),
};
}
// @ts-ignore TS6133
function CfnBucketOwnershipControlsPropertyFromCloudFormation(properties: any): CfnBucket.OwnershipControlsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
rules: cfn_parse.FromCloudFormation.getArray(CfnBucketOwnershipControlsRulePropertyFromCloudFormation)(properties.Rules),
...cfn_parse.FromCloudFormation.omit(properties, 'Rules'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrolsrule.html
*/
export interface OwnershipControlsRuleProperty {
/**
* `CfnBucket.OwnershipControlsRuleProperty.ObjectOwnership`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrolsrule.html#cfn-s3-bucket-ownershipcontrolsrule-objectownership
*/
readonly objectOwnership?: string;
}
}
/**
* Determine whether the given properties match those of a `OwnershipControlsRuleProperty`
*
* @param properties - the TypeScript properties of a `OwnershipControlsRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_OwnershipControlsRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('objectOwnership', cdk.validateString)(properties.objectOwnership));
return errors.wrap('supplied properties not correct for "OwnershipControlsRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.OwnershipControlsRule` resource
*
* @param properties - the TypeScript properties of a `OwnershipControlsRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.OwnershipControlsRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketOwnershipControlsRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_OwnershipControlsRulePropertyValidator(properties).assertSuccess();
return {
ObjectOwnership: cdk.stringToCloudFormation(properties.objectOwnership),
...cfn_parse.FromCloudFormation.omit(properties, 'objectOwnership'),
};
}
// @ts-ignore TS6133
function CfnBucketOwnershipControlsRulePropertyFromCloudFormation(properties: any): CfnBucket.OwnershipControlsRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
objectOwnership: properties.ObjectOwnership != null ? cfn_parse.FromCloudFormation.getString(properties.ObjectOwnership) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'ObjectOwnership'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'blockPublicAcls', 'blockPublicPolicy', 'ignorePublicAcls', '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 ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls) : undefined,
blockPublicPolicy: properties.BlockPublicPolicy != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy) : undefined,
ignorePublicAcls: properties.IgnorePublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls) : undefined,
restrictPublicBuckets: properties.RestrictPublicBuckets != null ? cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'event', 'filter', '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 ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined,
queue: cfn_parse.FromCloudFormation.getString(properties.Queue),
...cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'hostName', '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 ? cfn_parse.FromCloudFormation.getString(properties.Protocol) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'HostName', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'hostName', 'httpRedirectCode', 'protocol', 'replaceKeyPrefixWith', '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 ? cfn_parse.FromCloudFormation.getString(properties.HostName) : undefined,
httpRedirectCode: properties.HttpRedirectCode != null ? cfn_parse.FromCloudFormation.getString(properties.HttpRedirectCode) : undefined,
protocol: properties.Protocol != null ? cfn_parse.FromCloudFormation.getString(properties.Protocol) : undefined,
replaceKeyPrefixWith: properties.ReplaceKeyPrefixWith != null ? cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyPrefixWith) : undefined,
replaceKeyWith: properties.ReplaceKeyWith != null ? cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyWith) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'HostName', 'HttpRedirectCode', 'Protocol', 'ReplaceKeyPrefixWith', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'role', '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(CfnBucketReplicationRulePropertyFromCloudFormation)(properties.Rules),
...cfn_parse.FromCloudFormation.omit(properties, 'Role', 'Rules'),
};
}
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.Metrics`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-metrics
*/
readonly metrics?: CfnBucket.MetricsProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationDestinationProperty.ReplicationTime`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules-destination.html#cfn-s3-bucket-replicationdestination-replicationtime
*/
readonly replicationTime?: CfnBucket.ReplicationTimeProperty | 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('metrics', CfnBucket_MetricsPropertyValidator)(properties.metrics));
errors.collect(cdk.propertyValidator('replicationTime', CfnBucket_ReplicationTimePropertyValidator)(properties.replicationTime));
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),
Metrics: cfnBucketMetricsPropertyToCloudFormation(properties.metrics),
ReplicationTime: cfnBucketReplicationTimePropertyToCloudFormation(properties.replicationTime),
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
...cfn_parse.FromCloudFormation.omit(properties, 'accessControlTranslation', 'account', 'bucket', 'encryptionConfiguration', 'metrics', 'replicationTime', '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 ? CfnBucketAccessControlTranslationPropertyFromCloudFormation(properties.AccessControlTranslation) : undefined,
account: properties.Account != null ? cfn_parse.FromCloudFormation.getString(properties.Account) : undefined,
bucket: cfn_parse.FromCloudFormation.getString(properties.Bucket),
encryptionConfiguration: properties.EncryptionConfiguration != null ? CfnBucketEncryptionConfigurationPropertyFromCloudFormation(properties.EncryptionConfiguration) : undefined,
metrics: properties.Metrics != null ? CfnBucketMetricsPropertyFromCloudFormation(properties.Metrics) : undefined,
replicationTime: properties.ReplicationTime != null ? CfnBucketReplicationTimePropertyFromCloudFormation(properties.ReplicationTime) : undefined,
storageClass: properties.StorageClass != null ? cfn_parse.FromCloudFormation.getString(properties.StorageClass) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AccessControlTranslation', 'Account', 'Bucket', 'EncryptionConfiguration', 'Metrics', 'ReplicationTime', '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.DeleteMarkerReplication`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-deletemarkerreplication
*/
readonly deleteMarkerReplication?: CfnBucket.DeleteMarkerReplicationProperty | cdk.IResolvable;
/**
* `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.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-filter
*/
readonly filter?: CfnBucket.ReplicationRuleFilterProperty | 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.Priority`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration-rules.html#cfn-s3-bucket-replicationrule-priority
*/
readonly priority?: number;
/**
* `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('deleteMarkerReplication', CfnBucket_DeleteMarkerReplicationPropertyValidator)(properties.deleteMarkerReplication));
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_ReplicationDestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('filter', CfnBucket_ReplicationRuleFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('priority', cdk.validateNumber)(properties.priority));
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 {
DeleteMarkerReplication: cfnBucketDeleteMarkerReplicationPropertyToCloudFormation(properties.deleteMarkerReplication),
Destination: cfnBucketReplicationDestinationPropertyToCloudFormation(properties.destination),
Filter: cfnBucketReplicationRuleFilterPropertyToCloudFormation(properties.filter),
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
Priority: cdk.numberToCloudFormation(properties.priority),
SourceSelectionCriteria: cfnBucketSourceSelectionCriteriaPropertyToCloudFormation(properties.sourceSelectionCriteria),
Status: cdk.stringToCloudFormation(properties.status),
...cfn_parse.FromCloudFormation.omit(properties, 'deleteMarkerReplication', 'destination', 'filter', 'id', 'prefix', 'priority', 'sourceSelectionCriteria', 'status'),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRulePropertyFromCloudFormation(properties: any): CfnBucket.ReplicationRuleProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
deleteMarkerReplication: properties.DeleteMarkerReplication != null ? CfnBucketDeleteMarkerReplicationPropertyFromCloudFormation(properties.DeleteMarkerReplication) : undefined,
destination: CfnBucketReplicationDestinationPropertyFromCloudFormation(properties.Destination),
filter: properties.Filter != null ? CfnBucketReplicationRuleFilterPropertyFromCloudFormation(properties.Filter) : undefined,
id: properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined,
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
priority: properties.Priority != null ? cfn_parse.FromCloudFormation.getNumber(properties.Priority) : undefined,
sourceSelectionCriteria: properties.SourceSelectionCriteria != null ? CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties.SourceSelectionCriteria) : undefined,
status: cfn_parse.FromCloudFormation.getString(properties.Status),
...cfn_parse.FromCloudFormation.omit(properties, 'DeleteMarkerReplication', 'Destination', 'Filter', 'Id', 'Prefix', 'Priority', 'SourceSelectionCriteria', 'Status'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationruleandoperator.html
*/
export interface ReplicationRuleAndOperatorProperty {
/**
* `CfnBucket.ReplicationRuleAndOperatorProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationruleandoperator.html#cfn-s3-bucket-replicationruleandoperator-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.ReplicationRuleAndOperatorProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationruleandoperator.html#cfn-s3-bucket-replicationruleandoperator-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ReplicationRuleAndOperatorProperty`
*
* @param properties - the TypeScript properties of a `ReplicationRuleAndOperatorProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationRuleAndOperatorPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
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 "ReplicationRuleAndOperatorProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRuleAndOperator` resource
*
* @param properties - the TypeScript properties of a `ReplicationRuleAndOperatorProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRuleAndOperator` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationRuleAndOperatorPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationRuleAndOperatorPropertyValidator(properties).assertSuccess();
return {
Prefix: cdk.stringToCloudFormation(properties.prefix),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
...cfn_parse.FromCloudFormation.omit(properties, 'prefix', 'tagFilters'),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRuleAndOperatorPropertyFromCloudFormation(properties: any): CfnBucket.ReplicationRuleAndOperatorProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
tagFilters: properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Prefix', 'TagFilters'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html
*/
export interface ReplicationRuleFilterProperty {
/**
* `CfnBucket.ReplicationRuleFilterProperty.And`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-and
*/
readonly and?: CfnBucket.ReplicationRuleAndOperatorProperty | cdk.IResolvable;
/**
* `CfnBucket.ReplicationRuleFilterProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.ReplicationRuleFilterProperty.TagFilter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationrulefilter.html#cfn-s3-bucket-replicationrulefilter-tagfilter
*/
readonly tagFilter?: CfnBucket.TagFilterProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ReplicationRuleFilterProperty`
*
* @param properties - the TypeScript properties of a `ReplicationRuleFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationRuleFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('and', CfnBucket_ReplicationRuleAndOperatorPropertyValidator)(properties.and));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('tagFilter', CfnBucket_TagFilterPropertyValidator)(properties.tagFilter));
return errors.wrap('supplied properties not correct for "ReplicationRuleFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRuleFilter` resource
*
* @param properties - the TypeScript properties of a `ReplicationRuleFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationRuleFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationRuleFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationRuleFilterPropertyValidator(properties).assertSuccess();
return {
And: cfnBucketReplicationRuleAndOperatorPropertyToCloudFormation(properties.and),
Prefix: cdk.stringToCloudFormation(properties.prefix),
TagFilter: cfnBucketTagFilterPropertyToCloudFormation(properties.tagFilter),
...cfn_parse.FromCloudFormation.omit(properties, 'and', 'prefix', 'tagFilter'),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRuleFilterPropertyFromCloudFormation(properties: any): CfnBucket.ReplicationRuleFilterProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
and: properties.And != null ? CfnBucketReplicationRuleAndOperatorPropertyFromCloudFormation(properties.And) : undefined,
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
tagFilter: properties.TagFilter != null ? CfnBucketTagFilterPropertyFromCloudFormation(properties.TagFilter) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'And', 'Prefix', 'TagFilter'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtime.html
*/
export interface ReplicationTimeProperty {
/**
* `CfnBucket.ReplicationTimeProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtime.html#cfn-s3-bucket-replicationtime-status
*/
readonly status: string;
/**
* `CfnBucket.ReplicationTimeProperty.Time`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtime.html#cfn-s3-bucket-replicationtime-time
*/
readonly time: CfnBucket.ReplicationTimeValueProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ReplicationTimeProperty`
*
* @param properties - the TypeScript properties of a `ReplicationTimeProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationTimePropertyValidator(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));
errors.collect(cdk.propertyValidator('time', cdk.requiredValidator)(properties.time));
errors.collect(cdk.propertyValidator('time', CfnBucket_ReplicationTimeValuePropertyValidator)(properties.time));
return errors.wrap('supplied properties not correct for "ReplicationTimeProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationTime` resource
*
* @param properties - the TypeScript properties of a `ReplicationTimeProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationTime` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationTimePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationTimePropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
Time: cfnBucketReplicationTimeValuePropertyToCloudFormation(properties.time),
...cfn_parse.FromCloudFormation.omit(properties, 'status', 'time'),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationTimePropertyFromCloudFormation(properties: any): CfnBucket.ReplicationTimeProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
status: cfn_parse.FromCloudFormation.getString(properties.Status),
time: CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties.Time),
...cfn_parse.FromCloudFormation.omit(properties, 'Status', 'Time'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtimevalue.html
*/
export interface ReplicationTimeValueProperty {
/**
* `CfnBucket.ReplicationTimeValueProperty.Minutes`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationtimevalue.html#cfn-s3-bucket-replicationtimevalue-minutes
*/
readonly minutes: number;
}
}
/**
* Determine whether the given properties match those of a `ReplicationTimeValueProperty`
*
* @param properties - the TypeScript properties of a `ReplicationTimeValueProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationTimeValuePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('minutes', cdk.requiredValidator)(properties.minutes));
errors.collect(cdk.propertyValidator('minutes', cdk.validateNumber)(properties.minutes));
return errors.wrap('supplied properties not correct for "ReplicationTimeValueProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationTimeValue` resource
*
* @param properties - the TypeScript properties of a `ReplicationTimeValueProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationTimeValue` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationTimeValuePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationTimeValuePropertyValidator(properties).assertSuccess();
return {
Minutes: cdk.numberToCloudFormation(properties.minutes),
...cfn_parse.FromCloudFormation.omit(properties, 'minutes'),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties: any): CfnBucket.ReplicationTimeValueProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
minutes: cfn_parse.FromCloudFormation.getNumber(properties.Minutes),
...cfn_parse.FromCloudFormation.omit(properties, 'Minutes'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'redirectRule', '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 ? CfnBucketRoutingRuleConditionPropertyFromCloudFormation(properties.RoutingRuleCondition) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'RedirectRule', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'httpErrorCodeReturnedEquals', '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 ? cfn_parse.FromCloudFormation.getString(properties.HttpErrorCodeReturnedEquals) : undefined,
keyPrefixEquals: properties.KeyPrefixEquals != null ? cfn_parse.FromCloudFormation.getString(properties.KeyPrefixEquals) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'HttpErrorCodeReturnedEquals', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'abortIncompleteMultipartUpload', 'expirationDate', 'expirationInDays', 'id', 'noncurrentVersionExpirationInDays', 'noncurrentVersionTransition', 'noncurrentVersionTransitions', 'prefix', 'status', 'tagFilters', 'transition', '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 ? CfnBucketAbortIncompleteMultipartUploadPropertyFromCloudFormation(properties.AbortIncompleteMultipartUpload) : undefined,
expirationDate: properties.ExpirationDate != null ? cfn_parse.FromCloudFormation.getDate(properties.ExpirationDate) : undefined,
expirationInDays: properties.ExpirationInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.ExpirationInDays) : undefined,
id: properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined,
noncurrentVersionExpirationInDays: properties.NoncurrentVersionExpirationInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.NoncurrentVersionExpirationInDays) : undefined,
noncurrentVersionTransition: properties.NoncurrentVersionTransition != null ? CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(properties.NoncurrentVersionTransition) : undefined,
noncurrentVersionTransitions: properties.NoncurrentVersionTransitions != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation)(properties.NoncurrentVersionTransitions) : undefined,
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
status: cfn_parse.FromCloudFormation.getString(properties.Status),
tagFilters: properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined,
transition: properties.Transition != null ? CfnBucketTransitionPropertyFromCloudFormation(properties.Transition) : undefined,
transitions: properties.Transitions != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTransitionPropertyFromCloudFormation)(properties.Transitions) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AbortIncompleteMultipartUpload', 'ExpirationDate', 'ExpirationInDays', 'Id', 'NoncurrentVersionExpirationInDays', 'NoncurrentVersionTransition', 'NoncurrentVersionTransitions', 'Prefix', 'Status', 'TagFilters', 'Transition', 'Transitions'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(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(CfnBucketFilterRulePropertyFromCloudFormation)(properties.Rules),
...cfn_parse.FromCloudFormation.omit(properties, 'Rules'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'kmsMasterKeyId', '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 ? cfn_parse.FromCloudFormation.getString(properties.KMSMasterKeyID) : undefined,
sseAlgorithm: cfn_parse.FromCloudFormation.getString(properties.SSEAlgorithm),
...cfn_parse.FromCloudFormation.omit(properties, 'KMSMasterKeyID', '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),
...cfn_parse.FromCloudFormation.omit(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 ? CfnBucketServerSideEncryptionByDefaultPropertyFromCloudFormation(properties.ServerSideEncryptionByDefault) : undefined,
...cfn_parse.FromCloudFormation.omit(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', 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),
...cfn_parse.FromCloudFormation.omit(properties, 'sseKmsEncryptedObjects'),
};
}
// @ts-ignore TS6133
function CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties: any): CfnBucket.SourceSelectionCriteriaProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
sseKmsEncryptedObjects: properties.SseKmsEncryptedObjects != null ? CfnBucketSseKmsEncryptedObjectsPropertyFromCloudFormation(properties.SseKmsEncryptedObjects) : undefined,
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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 ? CfnBucketDataExportPropertyFromCloudFormation(properties.DataExport) : undefined,
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(properties, 'key', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'Key', 'Value'),
};
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html
*/
export interface TieringProperty {
/**
* `CfnBucket.TieringProperty.AccessTier`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html#cfn-s3-bucket-tiering-accesstier
*/
readonly accessTier: string;
/**
* `CfnBucket.TieringProperty.Days`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tiering.html#cfn-s3-bucket-tiering-days
*/
readonly days: number;
}
}
/**
* Determine whether the given properties match those of a `TieringProperty`
*
* @param properties - the TypeScript properties of a `TieringProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TieringPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accessTier', cdk.requiredValidator)(properties.accessTier));
errors.collect(cdk.propertyValidator('accessTier', cdk.validateString)(properties.accessTier));
errors.collect(cdk.propertyValidator('days', cdk.requiredValidator)(properties.days));
errors.collect(cdk.propertyValidator('days', cdk.validateNumber)(properties.days));
return errors.wrap('supplied properties not correct for "TieringProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Tiering` resource
*
* @param properties - the TypeScript properties of a `TieringProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Tiering` resource.
*/
// @ts-ignore TS6133
function cfnBucketTieringPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TieringPropertyValidator(properties).assertSuccess();
return {
AccessTier: cdk.stringToCloudFormation(properties.accessTier),
Days: cdk.numberToCloudFormation(properties.days),
...cfn_parse.FromCloudFormation.omit(properties, 'accessTier', 'days'),
};
}
// @ts-ignore TS6133
function CfnBucketTieringPropertyFromCloudFormation(properties: any): CfnBucket.TieringProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
accessTier: cfn_parse.FromCloudFormation.getString(properties.AccessTier),
days: cfn_parse.FromCloudFormation.getNumber(properties.Days),
...cfn_parse.FromCloudFormation.omit(properties, 'AccessTier', 'Days'),
};
}
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),
...cfn_parse.FromCloudFormation.omit(properties, 'event', 'filter', '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 ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined,
topic: cfn_parse.FromCloudFormation.getString(properties.Topic),
...cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'storageClass', 'transitionDate', '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 ? cfn_parse.FromCloudFormation.getDate(properties.TransitionDate) : undefined,
transitionInDays: properties.TransitionInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.TransitionInDays) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'StorageClass', 'TransitionDate', '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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(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),
...cfn_parse.FromCloudFormation.omit(properties, 'errorDocument', 'indexDocument', 'redirectAllRequestsTo', '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 ? cfn_parse.FromCloudFormation.getString(properties.ErrorDocument) : undefined,
indexDocument: properties.IndexDocument != null ? cfn_parse.FromCloudFormation.getString(properties.IndexDocument) : undefined,
redirectAllRequestsTo: properties.RedirectAllRequestsTo != null ? CfnBucketRedirectAllRequestsToPropertyFromCloudFormation(properties.RedirectAllRequestsTo) : undefined,
routingRules: properties.RoutingRules != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketRoutingRulePropertyFromCloudFormation)(properties.RoutingRules) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'ErrorDocument', 'IndexDocument', 'RedirectAllRequestsTo', 'RoutingRules'),
};
}
/**
* 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),
...cfn_parse.FromCloudFormation.omit(properties, 'bucket', '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),
...cfn_parse.FromCloudFormation.omit(properties, 'Bucket', '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.
*
* @internal
*/
public static _fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnBucketPolicy {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const props = CfnBucketPolicyPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucketPolicy(scope, id, props);
options.parser.handleAttributes(ret, resourceAttributes, id);
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,
...cfn_parse.FromCloudFormation.omit(this._cfnProperties, 'bucket', 'policyDocument'),
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnBucketPolicyPropsToCloudFormation(props);
}
}
/**
* Properties for defining a `AWS::S3::StorageLens`
*
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html
*/
export interface CfnStorageLensProps {
/**
* `AWS::S3::StorageLens.StorageLensConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-storagelensconfiguration
*/
readonly storageLensConfiguration: CfnStorageLens.StorageLensConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::StorageLens.Tags`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-tags
*/
readonly tags?: cdk.CfnTag[];
}
/**
* Determine whether the given properties match those of a `CfnStorageLensProps`
*
* @param properties - the TypeScript properties of a `CfnStorageLensProps`
*
* @returns the result of the validation.
*/
function CfnStorageLensPropsValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageLensConfiguration', cdk.requiredValidator)(properties.storageLensConfiguration));
errors.collect(cdk.propertyValidator('storageLensConfiguration', CfnStorageLens_StorageLensConfigurationPropertyValidator)(properties.storageLensConfiguration));
errors.collect(cdk.propertyValidator('tags', cdk.listValidator(cdk.validateCfnTag))(properties.tags));
return errors.wrap('supplied properties not correct for "CfnStorageLensProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens` resource
*
* @param properties - the TypeScript properties of a `CfnStorageLensProps`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensPropsToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLensPropsValidator(properties).assertSuccess();
return {
StorageLensConfiguration: cfnStorageLensStorageLensConfigurationPropertyToCloudFormation(properties.storageLensConfiguration),
Tags: cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags),
...cfn_parse.FromCloudFormation.omit(properties, 'storageLensConfiguration', 'tags'),
};
}
// @ts-ignore TS6133
function CfnStorageLensPropsFromCloudFormation(properties: any): CfnStorageLensProps {
properties = properties || {};
return {
storageLensConfiguration: CfnStorageLensStorageLensConfigurationPropertyFromCloudFormation(properties.StorageLensConfiguration),
tags: properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined as any,
...cfn_parse.FromCloudFormation.omit(properties, 'StorageLensConfiguration', 'Tags'),
};
}
/**
* A CloudFormation `AWS::S3::StorageLens`
*
* @cloudformationResource AWS::S3::StorageLens
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html
*/
export class CfnStorageLens extends cdk.CfnResource implements cdk.IInspectable {
/**
* The CloudFormation resource type name for this resource class.
*/
public static readonly CFN_RESOURCE_TYPE_NAME = "AWS::S3::StorageLens";
/**
* 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.
*
* @internal
*/
public static _fromCloudFormation(scope: cdk.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnStorageLens {
resourceAttributes = resourceAttributes || {};
const resourceProperties = options.parser.parseValue(resourceAttributes.Properties);
const props = CfnStorageLensPropsFromCloudFormation(resourceProperties);
const ret = new CfnStorageLens(scope, id, props);
options.parser.handleAttributes(ret, resourceAttributes, id);
return ret;
}
/**
* @cloudformationAttribute StorageLensArn
*/
public readonly attrStorageLensArn: string;
/**
* `AWS::S3::StorageLens.StorageLensConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-storagelensconfiguration
*/
public storageLensConfiguration: CfnStorageLens.StorageLensConfigurationProperty | cdk.IResolvable;
/**
* `AWS::S3::StorageLens.Tags`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-tags
*/
public readonly tags: cdk.TagManager;
/**
* Create a new `AWS::S3::StorageLens`.
*
* @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: CfnStorageLensProps) {
super(scope, id, { type: CfnStorageLens.CFN_RESOURCE_TYPE_NAME, properties: props });
cdk.requireProperty(props, 'storageLensConfiguration', this);
this.attrStorageLensArn = cdk.Token.asString(this.getAtt('StorageLensArn'));
this.storageLensConfiguration = props.storageLensConfiguration;
this.tags = new cdk.TagManager(cdk.TagType.STANDARD, "AWS::S3::StorageLens", props.tags, { tagPropertyName: 'tags' });
}
/**
* 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", CfnStorageLens.CFN_RESOURCE_TYPE_NAME);
inspector.addAttribute("aws:cdk:cloudformation:props", this.cfnProperties);
}
protected get cfnProperties(): { [key: string]: any } {
return {
storageLensConfiguration: this.storageLensConfiguration,
tags: this.tags.renderTags(),
...cfn_parse.FromCloudFormation.omit(this._cfnProperties, 'storageLensConfiguration', 'tags'),
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnStorageLensPropsToCloudFormation(props);
}
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-accountlevel.html
*/
export interface AccountLevelProperty {
/**
* `CfnStorageLens.AccountLevelProperty.ActivityMetrics`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-accountlevel.html#cfn-s3-storagelens-accountlevel-activitymetrics
*/
readonly activityMetrics?: CfnStorageLens.ActivityMetricsProperty | cdk.IResolvable;
/**
* `CfnStorageLens.AccountLevelProperty.BucketLevel`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-accountlevel.html#cfn-s3-storagelens-accountlevel-bucketlevel
*/
readonly bucketLevel: CfnStorageLens.BucketLevelProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `AccountLevelProperty`
*
* @param properties - the TypeScript properties of a `AccountLevelProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_AccountLevelPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('activityMetrics', CfnStorageLens_ActivityMetricsPropertyValidator)(properties.activityMetrics));
errors.collect(cdk.propertyValidator('bucketLevel', cdk.requiredValidator)(properties.bucketLevel));
errors.collect(cdk.propertyValidator('bucketLevel', CfnStorageLens_BucketLevelPropertyValidator)(properties.bucketLevel));
return errors.wrap('supplied properties not correct for "AccountLevelProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.AccountLevel` resource
*
* @param properties - the TypeScript properties of a `AccountLevelProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.AccountLevel` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensAccountLevelPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_AccountLevelPropertyValidator(properties).assertSuccess();
return {
ActivityMetrics: cfnStorageLensActivityMetricsPropertyToCloudFormation(properties.activityMetrics),
BucketLevel: cfnStorageLensBucketLevelPropertyToCloudFormation(properties.bucketLevel),
...cfn_parse.FromCloudFormation.omit(properties, 'activityMetrics', 'bucketLevel'),
};
}
// @ts-ignore TS6133
function CfnStorageLensAccountLevelPropertyFromCloudFormation(properties: any): CfnStorageLens.AccountLevelProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
activityMetrics: properties.ActivityMetrics != null ? CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties.ActivityMetrics) : undefined,
bucketLevel: CfnStorageLensBucketLevelPropertyFromCloudFormation(properties.BucketLevel),
...cfn_parse.FromCloudFormation.omit(properties, 'ActivityMetrics', 'BucketLevel'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-activitymetrics.html
*/
export interface ActivityMetricsProperty {
/**
* `CfnStorageLens.ActivityMetricsProperty.IsEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-activitymetrics.html#cfn-s3-storagelens-activitymetrics-isenabled
*/
readonly isEnabled?: boolean | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ActivityMetricsProperty`
*
* @param properties - the TypeScript properties of a `ActivityMetricsProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_ActivityMetricsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('isEnabled', cdk.validateBoolean)(properties.isEnabled));
return errors.wrap('supplied properties not correct for "ActivityMetricsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.ActivityMetrics` resource
*
* @param properties - the TypeScript properties of a `ActivityMetricsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.ActivityMetrics` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensActivityMetricsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_ActivityMetricsPropertyValidator(properties).assertSuccess();
return {
IsEnabled: cdk.booleanToCloudFormation(properties.isEnabled),
...cfn_parse.FromCloudFormation.omit(properties, 'isEnabled'),
};
}
// @ts-ignore TS6133
function CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties: any): CfnStorageLens.ActivityMetricsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
isEnabled: properties.IsEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'IsEnabled'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-awsorg.html
*/
export interface AwsOrgProperty {
/**
* `CfnStorageLens.AwsOrgProperty.Arn`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-awsorg.html#cfn-s3-storagelens-awsorg-arn
*/
readonly arn: string;
}
}
/**
* Determine whether the given properties match those of a `AwsOrgProperty`
*
* @param properties - the TypeScript properties of a `AwsOrgProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_AwsOrgPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('arn', cdk.requiredValidator)(properties.arn));
errors.collect(cdk.propertyValidator('arn', cdk.validateString)(properties.arn));
return errors.wrap('supplied properties not correct for "AwsOrgProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.AwsOrg` resource
*
* @param properties - the TypeScript properties of a `AwsOrgProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.AwsOrg` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensAwsOrgPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_AwsOrgPropertyValidator(properties).assertSuccess();
return {
Arn: cdk.stringToCloudFormation(properties.arn),
...cfn_parse.FromCloudFormation.omit(properties, 'arn'),
};
}
// @ts-ignore TS6133
function CfnStorageLensAwsOrgPropertyFromCloudFormation(properties: any): CfnStorageLens.AwsOrgProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
arn: cfn_parse.FromCloudFormation.getString(properties.Arn),
...cfn_parse.FromCloudFormation.omit(properties, 'Arn'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketlevel.html
*/
export interface BucketLevelProperty {
/**
* `CfnStorageLens.BucketLevelProperty.ActivityMetrics`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketlevel.html#cfn-s3-storagelens-bucketlevel-activitymetrics
*/
readonly activityMetrics?: CfnStorageLens.ActivityMetricsProperty | cdk.IResolvable;
/**
* `CfnStorageLens.BucketLevelProperty.PrefixLevel`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketlevel.html#cfn-s3-storagelens-bucketlevel-prefixlevel
*/
readonly prefixLevel?: CfnStorageLens.PrefixLevelProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `BucketLevelProperty`
*
* @param properties - the TypeScript properties of a `BucketLevelProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_BucketLevelPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('activityMetrics', CfnStorageLens_ActivityMetricsPropertyValidator)(properties.activityMetrics));
errors.collect(cdk.propertyValidator('prefixLevel', CfnStorageLens_PrefixLevelPropertyValidator)(properties.prefixLevel));
return errors.wrap('supplied properties not correct for "BucketLevelProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.BucketLevel` resource
*
* @param properties - the TypeScript properties of a `BucketLevelProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.BucketLevel` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensBucketLevelPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_BucketLevelPropertyValidator(properties).assertSuccess();
return {
ActivityMetrics: cfnStorageLensActivityMetricsPropertyToCloudFormation(properties.activityMetrics),
PrefixLevel: cfnStorageLensPrefixLevelPropertyToCloudFormation(properties.prefixLevel),
...cfn_parse.FromCloudFormation.omit(properties, 'activityMetrics', 'prefixLevel'),
};
}
// @ts-ignore TS6133
function CfnStorageLensBucketLevelPropertyFromCloudFormation(properties: any): CfnStorageLens.BucketLevelProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
activityMetrics: properties.ActivityMetrics != null ? CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties.ActivityMetrics) : undefined,
prefixLevel: properties.PrefixLevel != null ? CfnStorageLensPrefixLevelPropertyFromCloudFormation(properties.PrefixLevel) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'ActivityMetrics', 'PrefixLevel'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketsandregions.html
*/
export interface BucketsAndRegionsProperty {
/**
* `CfnStorageLens.BucketsAndRegionsProperty.Buckets`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketsandregions.html#cfn-s3-storagelens-bucketsandregions-buckets
*/
readonly buckets?: string[];
/**
* `CfnStorageLens.BucketsAndRegionsProperty.Regions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-bucketsandregions.html#cfn-s3-storagelens-bucketsandregions-regions
*/
readonly regions?: string[];
}
}
/**
* Determine whether the given properties match those of a `BucketsAndRegionsProperty`
*
* @param properties - the TypeScript properties of a `BucketsAndRegionsProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_BucketsAndRegionsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('buckets', cdk.listValidator(cdk.validateString))(properties.buckets));
errors.collect(cdk.propertyValidator('regions', cdk.listValidator(cdk.validateString))(properties.regions));
return errors.wrap('supplied properties not correct for "BucketsAndRegionsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.BucketsAndRegions` resource
*
* @param properties - the TypeScript properties of a `BucketsAndRegionsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.BucketsAndRegions` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensBucketsAndRegionsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_BucketsAndRegionsPropertyValidator(properties).assertSuccess();
return {
Buckets: cdk.listMapper(cdk.stringToCloudFormation)(properties.buckets),
Regions: cdk.listMapper(cdk.stringToCloudFormation)(properties.regions),
...cfn_parse.FromCloudFormation.omit(properties, 'buckets', 'regions'),
};
}
// @ts-ignore TS6133
function CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties: any): CfnStorageLens.BucketsAndRegionsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
buckets: properties.Buckets != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Buckets) : undefined,
regions: properties.Regions != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Regions) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Buckets', 'Regions'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-dataexport.html
*/
export interface DataExportProperty {
/**
* `CfnStorageLens.DataExportProperty.S3BucketDestination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-dataexport.html#cfn-s3-storagelens-dataexport-s3bucketdestination
*/
readonly s3BucketDestination: CfnStorageLens.S3BucketDestinationProperty | cdk.IResolvable;
}
}
/**
* 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 CfnStorageLens_DataExportPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('s3BucketDestination', cdk.requiredValidator)(properties.s3BucketDestination));
errors.collect(cdk.propertyValidator('s3BucketDestination', CfnStorageLens_S3BucketDestinationPropertyValidator)(properties.s3BucketDestination));
return errors.wrap('supplied properties not correct for "DataExportProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.DataExport` resource
*
* @param properties - the TypeScript properties of a `DataExportProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.DataExport` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensDataExportPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_DataExportPropertyValidator(properties).assertSuccess();
return {
S3BucketDestination: cfnStorageLensS3BucketDestinationPropertyToCloudFormation(properties.s3BucketDestination),
...cfn_parse.FromCloudFormation.omit(properties, 's3BucketDestination'),
};
}
// @ts-ignore TS6133
function CfnStorageLensDataExportPropertyFromCloudFormation(properties: any): CfnStorageLens.DataExportProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
s3BucketDestination: CfnStorageLensS3BucketDestinationPropertyFromCloudFormation(properties.S3BucketDestination),
...cfn_parse.FromCloudFormation.omit(properties, 'S3BucketDestination'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-encryption.html
*/
export interface EncryptionProperty {
}
}
/**
* Determine whether the given properties match those of a `EncryptionProperty`
*
* @param properties - the TypeScript properties of a `EncryptionProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_EncryptionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
return errors.wrap('supplied properties not correct for "EncryptionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.Encryption` resource
*
* @param properties - the TypeScript properties of a `EncryptionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.Encryption` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensEncryptionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_EncryptionPropertyValidator(properties).assertSuccess();
return {
...cfn_parse.FromCloudFormation.omit(properties, ),
};
}
// @ts-ignore TS6133
function CfnStorageLensEncryptionPropertyFromCloudFormation(properties: any): CfnStorageLens.EncryptionProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
...cfn_parse.FromCloudFormation.omit(properties, ),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-prefixlevel.html
*/
export interface PrefixLevelProperty {
/**
* `CfnStorageLens.PrefixLevelProperty.StorageMetrics`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-prefixlevel.html#cfn-s3-storagelens-prefixlevel-storagemetrics
*/
readonly storageMetrics: CfnStorageLens.PrefixLevelStorageMetricsProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PrefixLevelProperty`
*
* @param properties - the TypeScript properties of a `PrefixLevelProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_PrefixLevelPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageMetrics', cdk.requiredValidator)(properties.storageMetrics));
errors.collect(cdk.propertyValidator('storageMetrics', CfnStorageLens_PrefixLevelStorageMetricsPropertyValidator)(properties.storageMetrics));
return errors.wrap('supplied properties not correct for "PrefixLevelProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.PrefixLevel` resource
*
* @param properties - the TypeScript properties of a `PrefixLevelProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.PrefixLevel` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensPrefixLevelPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_PrefixLevelPropertyValidator(properties).assertSuccess();
return {
StorageMetrics: cfnStorageLensPrefixLevelStorageMetricsPropertyToCloudFormation(properties.storageMetrics),
...cfn_parse.FromCloudFormation.omit(properties, 'storageMetrics'),
};
}
// @ts-ignore TS6133
function CfnStorageLensPrefixLevelPropertyFromCloudFormation(properties: any): CfnStorageLens.PrefixLevelProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
storageMetrics: CfnStorageLensPrefixLevelStorageMetricsPropertyFromCloudFormation(properties.StorageMetrics),
...cfn_parse.FromCloudFormation.omit(properties, 'StorageMetrics'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-prefixlevelstoragemetrics.html
*/
export interface PrefixLevelStorageMetricsProperty {
/**
* `CfnStorageLens.PrefixLevelStorageMetricsProperty.IsEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-prefixlevelstoragemetrics.html#cfn-s3-storagelens-prefixlevelstoragemetrics-isenabled
*/
readonly isEnabled?: boolean | cdk.IResolvable;
/**
* `CfnStorageLens.PrefixLevelStorageMetricsProperty.SelectionCriteria`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-prefixlevelstoragemetrics.html#cfn-s3-storagelens-prefixlevelstoragemetrics-selectioncriteria
*/
readonly selectionCriteria?: CfnStorageLens.SelectionCriteriaProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PrefixLevelStorageMetricsProperty`
*
* @param properties - the TypeScript properties of a `PrefixLevelStorageMetricsProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_PrefixLevelStorageMetricsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('isEnabled', cdk.validateBoolean)(properties.isEnabled));
errors.collect(cdk.propertyValidator('selectionCriteria', CfnStorageLens_SelectionCriteriaPropertyValidator)(properties.selectionCriteria));
return errors.wrap('supplied properties not correct for "PrefixLevelStorageMetricsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.PrefixLevelStorageMetrics` resource
*
* @param properties - the TypeScript properties of a `PrefixLevelStorageMetricsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.PrefixLevelStorageMetrics` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensPrefixLevelStorageMetricsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_PrefixLevelStorageMetricsPropertyValidator(properties).assertSuccess();
return {
IsEnabled: cdk.booleanToCloudFormation(properties.isEnabled),
SelectionCriteria: cfnStorageLensSelectionCriteriaPropertyToCloudFormation(properties.selectionCriteria),
...cfn_parse.FromCloudFormation.omit(properties, 'isEnabled', 'selectionCriteria'),
};
}
// @ts-ignore TS6133
function CfnStorageLensPrefixLevelStorageMetricsPropertyFromCloudFormation(properties: any): CfnStorageLens.PrefixLevelStorageMetricsProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
isEnabled: properties.IsEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled) : undefined,
selectionCriteria: properties.SelectionCriteria != null ? CfnStorageLensSelectionCriteriaPropertyFromCloudFormation(properties.SelectionCriteria) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'IsEnabled', 'SelectionCriteria'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html
*/
export interface S3BucketDestinationProperty {
/**
* `CfnStorageLens.S3BucketDestinationProperty.AccountId`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-accountid
*/
readonly accountId: string;
/**
* `CfnStorageLens.S3BucketDestinationProperty.Arn`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-arn
*/
readonly arn: string;
/**
* `CfnStorageLens.S3BucketDestinationProperty.Encryption`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-encryption
*/
readonly encryption?: CfnStorageLens.EncryptionProperty | cdk.IResolvable;
/**
* `CfnStorageLens.S3BucketDestinationProperty.Format`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-format
*/
readonly format: string;
/**
* `CfnStorageLens.S3BucketDestinationProperty.OutputSchemaVersion`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-outputschemaversion
*/
readonly outputSchemaVersion: string;
/**
* `CfnStorageLens.S3BucketDestinationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-s3bucketdestination.html#cfn-s3-storagelens-s3bucketdestination-prefix
*/
readonly prefix?: string;
}
}
/**
* Determine whether the given properties match those of a `S3BucketDestinationProperty`
*
* @param properties - the TypeScript properties of a `S3BucketDestinationProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_S3BucketDestinationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accountId', cdk.requiredValidator)(properties.accountId));
errors.collect(cdk.propertyValidator('accountId', cdk.validateString)(properties.accountId));
errors.collect(cdk.propertyValidator('arn', cdk.requiredValidator)(properties.arn));
errors.collect(cdk.propertyValidator('arn', cdk.validateString)(properties.arn));
errors.collect(cdk.propertyValidator('encryption', CfnStorageLens_EncryptionPropertyValidator)(properties.encryption));
errors.collect(cdk.propertyValidator('format', cdk.requiredValidator)(properties.format));
errors.collect(cdk.propertyValidator('format', cdk.validateString)(properties.format));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.requiredValidator)(properties.outputSchemaVersion));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.validateString)(properties.outputSchemaVersion));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
return errors.wrap('supplied properties not correct for "S3BucketDestinationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.S3BucketDestination` resource
*
* @param properties - the TypeScript properties of a `S3BucketDestinationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.S3BucketDestination` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensS3BucketDestinationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_S3BucketDestinationPropertyValidator(properties).assertSuccess();
return {
AccountId: cdk.stringToCloudFormation(properties.accountId),
Arn: cdk.stringToCloudFormation(properties.arn),
Encryption: cfnStorageLensEncryptionPropertyToCloudFormation(properties.encryption),
Format: cdk.stringToCloudFormation(properties.format),
OutputSchemaVersion: cdk.stringToCloudFormation(properties.outputSchemaVersion),
Prefix: cdk.stringToCloudFormation(properties.prefix),
...cfn_parse.FromCloudFormation.omit(properties, 'accountId', 'arn', 'encryption', 'format', 'outputSchemaVersion', 'prefix'),
};
}
// @ts-ignore TS6133
function CfnStorageLensS3BucketDestinationPropertyFromCloudFormation(properties: any): CfnStorageLens.S3BucketDestinationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
accountId: cfn_parse.FromCloudFormation.getString(properties.AccountId),
arn: cfn_parse.FromCloudFormation.getString(properties.Arn),
encryption: properties.Encryption != null ? CfnStorageLensEncryptionPropertyFromCloudFormation(properties.Encryption) : undefined,
format: cfn_parse.FromCloudFormation.getString(properties.Format),
outputSchemaVersion: cfn_parse.FromCloudFormation.getString(properties.OutputSchemaVersion),
prefix: properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AccountId', 'Arn', 'Encryption', 'Format', 'OutputSchemaVersion', 'Prefix'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-selectioncriteria.html
*/
export interface SelectionCriteriaProperty {
/**
* `CfnStorageLens.SelectionCriteriaProperty.Delimiter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-selectioncriteria.html#cfn-s3-storagelens-selectioncriteria-delimiter
*/
readonly delimiter?: string;
/**
* `CfnStorageLens.SelectionCriteriaProperty.MaxDepth`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-selectioncriteria.html#cfn-s3-storagelens-selectioncriteria-maxdepth
*/
readonly maxDepth?: number;
/**
* `CfnStorageLens.SelectionCriteriaProperty.MinStorageBytesPercentage`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-selectioncriteria.html#cfn-s3-storagelens-selectioncriteria-minstoragebytespercentage
*/
readonly minStorageBytesPercentage?: number;
}
}
/**
* Determine whether the given properties match those of a `SelectionCriteriaProperty`
*
* @param properties - the TypeScript properties of a `SelectionCriteriaProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_SelectionCriteriaPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('delimiter', cdk.validateString)(properties.delimiter));
errors.collect(cdk.propertyValidator('maxDepth', cdk.validateNumber)(properties.maxDepth));
errors.collect(cdk.propertyValidator('minStorageBytesPercentage', cdk.validateNumber)(properties.minStorageBytesPercentage));
return errors.wrap('supplied properties not correct for "SelectionCriteriaProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.SelectionCriteria` resource
*
* @param properties - the TypeScript properties of a `SelectionCriteriaProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.SelectionCriteria` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensSelectionCriteriaPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_SelectionCriteriaPropertyValidator(properties).assertSuccess();
return {
Delimiter: cdk.stringToCloudFormation(properties.delimiter),
MaxDepth: cdk.numberToCloudFormation(properties.maxDepth),
MinStorageBytesPercentage: cdk.numberToCloudFormation(properties.minStorageBytesPercentage),
...cfn_parse.FromCloudFormation.omit(properties, 'delimiter', 'maxDepth', 'minStorageBytesPercentage'),
};
}
// @ts-ignore TS6133
function CfnStorageLensSelectionCriteriaPropertyFromCloudFormation(properties: any): CfnStorageLens.SelectionCriteriaProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
delimiter: properties.Delimiter != null ? cfn_parse.FromCloudFormation.getString(properties.Delimiter) : undefined,
maxDepth: properties.MaxDepth != null ? cfn_parse.FromCloudFormation.getNumber(properties.MaxDepth) : undefined,
minStorageBytesPercentage: properties.MinStorageBytesPercentage != null ? cfn_parse.FromCloudFormation.getNumber(properties.MinStorageBytesPercentage) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'Delimiter', 'MaxDepth', 'MinStorageBytesPercentage'),
};
}
export namespace CfnStorageLens {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html
*/
export interface StorageLensConfigurationProperty {
/**
* `CfnStorageLens.StorageLensConfigurationProperty.AccountLevel`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-accountlevel
*/
readonly accountLevel: CfnStorageLens.AccountLevelProperty | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.AwsOrg`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-awsorg
*/
readonly awsOrg?: CfnStorageLens.AwsOrgProperty | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.DataExport`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-dataexport
*/
readonly dataExport?: CfnStorageLens.DataExportProperty | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.Exclude`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-exclude
*/
readonly exclude?: CfnStorageLens.BucketsAndRegionsProperty | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-id
*/
readonly id: string;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.Include`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-include
*/
readonly include?: CfnStorageLens.BucketsAndRegionsProperty | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.IsEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-isenabled
*/
readonly isEnabled: boolean | cdk.IResolvable;
/**
* `CfnStorageLens.StorageLensConfigurationProperty.StorageLensArn`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-storagelens-storagelensconfiguration.html#cfn-s3-storagelens-storagelensconfiguration-storagelensarn
*/
readonly storageLensArn?: string;
}
}
/**
* Determine whether the given properties match those of a `StorageLensConfigurationProperty`
*
* @param properties - the TypeScript properties of a `StorageLensConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnStorageLens_StorageLensConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accountLevel', cdk.requiredValidator)(properties.accountLevel));
errors.collect(cdk.propertyValidator('accountLevel', CfnStorageLens_AccountLevelPropertyValidator)(properties.accountLevel));
errors.collect(cdk.propertyValidator('awsOrg', CfnStorageLens_AwsOrgPropertyValidator)(properties.awsOrg));
errors.collect(cdk.propertyValidator('dataExport', CfnStorageLens_DataExportPropertyValidator)(properties.dataExport));
errors.collect(cdk.propertyValidator('exclude', CfnStorageLens_BucketsAndRegionsPropertyValidator)(properties.exclude));
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('include', CfnStorageLens_BucketsAndRegionsPropertyValidator)(properties.include));
errors.collect(cdk.propertyValidator('isEnabled', cdk.requiredValidator)(properties.isEnabled));
errors.collect(cdk.propertyValidator('isEnabled', cdk.validateBoolean)(properties.isEnabled));
errors.collect(cdk.propertyValidator('storageLensArn', cdk.validateString)(properties.storageLensArn));
return errors.wrap('supplied properties not correct for "StorageLensConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::StorageLens.StorageLensConfiguration` resource
*
* @param properties - the TypeScript properties of a `StorageLensConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::StorageLens.StorageLensConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnStorageLensStorageLensConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnStorageLens_StorageLensConfigurationPropertyValidator(properties).assertSuccess();
return {
AccountLevel: cfnStorageLensAccountLevelPropertyToCloudFormation(properties.accountLevel),
AwsOrg: cfnStorageLensAwsOrgPropertyToCloudFormation(properties.awsOrg),
DataExport: cfnStorageLensDataExportPropertyToCloudFormation(properties.dataExport),
Exclude: cfnStorageLensBucketsAndRegionsPropertyToCloudFormation(properties.exclude),
Id: cdk.stringToCloudFormation(properties.id),
Include: cfnStorageLensBucketsAndRegionsPropertyToCloudFormation(properties.include),
IsEnabled: cdk.booleanToCloudFormation(properties.isEnabled),
StorageLensArn: cdk.stringToCloudFormation(properties.storageLensArn),
...cfn_parse.FromCloudFormation.omit(properties, 'accountLevel', 'awsOrg', 'dataExport', 'exclude', 'id', 'include', 'isEnabled', 'storageLensArn'),
};
}
// @ts-ignore TS6133
function CfnStorageLensStorageLensConfigurationPropertyFromCloudFormation(properties: any): CfnStorageLens.StorageLensConfigurationProperty | cdk.IResolvable {
if (cdk.isResolvableObject(properties)) {
return properties;
}
properties = properties || {};
return {
accountLevel: CfnStorageLensAccountLevelPropertyFromCloudFormation(properties.AccountLevel),
awsOrg: properties.AwsOrg != null ? CfnStorageLensAwsOrgPropertyFromCloudFormation(properties.AwsOrg) : undefined,
dataExport: properties.DataExport != null ? CfnStorageLensDataExportPropertyFromCloudFormation(properties.DataExport) : undefined,
exclude: properties.Exclude != null ? CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties.Exclude) : undefined,
id: cfn_parse.FromCloudFormation.getString(properties.Id),
include: properties.Include != null ? CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties.Include) : undefined,
isEnabled: cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled),
storageLensArn: properties.StorageLensArn != null ? cfn_parse.FromCloudFormation.getString(properties.StorageLensArn) : undefined,
...cfn_parse.FromCloudFormation.omit(properties, 'AccountLevel', 'AwsOrg', 'DataExport', 'Exclude', 'Id', 'Include', 'IsEnabled', 'StorageLensArn'),
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment