Skip to content

Instantly share code, notes, and snippets.

@skinny85
Created December 4, 2020 01:51
Show Gist options
  • Save skinny85/ed4dc3556c95b343f958f2e5e9689b44 to your computer and use it in GitHub Desktop.
Save skinny85/ed4dc3556c95b343f958f2e5e9689b44 to your computer and use it in GitHub Desktop.
s3.generated.ts with changes from https://github.com/aws/aws-cdk/pull/11822
// 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-04T01:12:12.315Z","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),
};
}
// @ts-ignore TS6133
function CfnAccessPointPropsFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnAccessPointProps> {
properties = properties || {};
const bucketResult = cfn_parse.FromCloudFormation.getString(properties.Bucket);
const creationDateResult = properties.CreationDate != null ? cfn_parse.FromCloudFormation.getString(properties.CreationDate) : undefined;
const nameResult = properties.Name != null ? cfn_parse.FromCloudFormation.getString(properties.Name) : undefined;
const networkOriginResult = properties.NetworkOrigin != null ? cfn_parse.FromCloudFormation.getString(properties.NetworkOrigin) : undefined;
const policyResult = properties.Policy != null ? cfn_parse.FromCloudFormation.getAny(properties.Policy) : undefined;
const policyStatusResult = properties.PolicyStatus != null ? cfn_parse.FromCloudFormation.getAny(properties.PolicyStatus) : undefined;
const publicAccessBlockConfigurationResult = properties.PublicAccessBlockConfiguration != null ? CfnAccessPointPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration) : undefined;
const vpcConfigurationResult = properties.VpcConfiguration != null ? CfnAccessPointVpcConfigurationPropertyFromCloudFormation(properties.VpcConfiguration) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
bucket: bucketResult?.value,
creationDate: creationDateResult?.value,
name: nameResult?.value,
networkOrigin: networkOriginResult?.value,
policy: policyResult?.value,
policyStatus: policyStatusResult?.value,
publicAccessBlockConfiguration: publicAccessBlockConfigurationResult?.value,
vpcConfiguration: vpcConfigurationResult?.value,
});
ret.appendExtraProperties('Bucket', bucketResult?.extraProperties);
ret.appendExtraProperties('CreationDate', creationDateResult?.extraProperties);
ret.appendExtraProperties('Name', nameResult?.extraProperties);
ret.appendExtraProperties('NetworkOrigin', networkOriginResult?.extraProperties);
ret.appendExtraProperties('Policy', policyResult?.extraProperties);
ret.appendExtraProperties('PolicyStatus', policyStatusResult?.extraProperties);
ret.appendExtraProperties('PublicAccessBlockConfiguration', publicAccessBlockConfigurationResult?.extraProperties);
ret.appendExtraProperties('VpcConfiguration', vpcConfigurationResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Bucket', 'CreationDate', 'Name', 'NetworkOrigin', 'Policy', 'PolicyStatus', 'PublicAccessBlockConfiguration', 'VpcConfiguration'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* 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 propsResult = CfnAccessPointPropsFromCloudFormation(resourceProperties);
const ret = new CfnAccessPoint(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
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,
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnAccessPointPropsToCloudFormation(props);
}
}
export namespace CfnAccessPoint {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html
*/
export interface PublicAccessBlockConfigurationProperty {
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.BlockPublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-blockpublicacls
*/
readonly blockPublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.BlockPublicPolicy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-blockpublicpolicy
*/
readonly blockPublicPolicy?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.IgnorePublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-ignorepublicacls
*/
readonly ignorePublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnAccessPoint.PublicAccessBlockConfigurationProperty.RestrictPublicBuckets`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-publicaccessblockconfiguration.html#cfn-s3-accesspoint-publicaccessblockconfiguration-restrictpublicbuckets
*/
readonly restrictPublicBuckets?: boolean | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PublicAccessBlockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnAccessPoint_PublicAccessBlockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('blockPublicAcls', cdk.validateBoolean)(properties.blockPublicAcls));
errors.collect(cdk.propertyValidator('blockPublicPolicy', cdk.validateBoolean)(properties.blockPublicPolicy));
errors.collect(cdk.propertyValidator('ignorePublicAcls', cdk.validateBoolean)(properties.ignorePublicAcls));
errors.collect(cdk.propertyValidator('restrictPublicBuckets', cdk.validateBoolean)(properties.restrictPublicBuckets));
return errors.wrap('supplied properties not correct for "PublicAccessBlockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::AccessPoint.PublicAccessBlockConfiguration` resource
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::AccessPoint.PublicAccessBlockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnAccessPointPublicAccessBlockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnAccessPoint_PublicAccessBlockConfigurationPropertyValidator(properties).assertSuccess();
return {
BlockPublicAcls: cdk.booleanToCloudFormation(properties.blockPublicAcls),
BlockPublicPolicy: cdk.booleanToCloudFormation(properties.blockPublicPolicy),
IgnorePublicAcls: cdk.booleanToCloudFormation(properties.ignorePublicAcls),
RestrictPublicBuckets: cdk.booleanToCloudFormation(properties.restrictPublicBuckets),
};
}
// @ts-ignore TS6133
function CfnAccessPointPublicAccessBlockConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnAccessPoint.PublicAccessBlockConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const blockPublicAclsResult = properties.BlockPublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls) : undefined;
const blockPublicPolicyResult = properties.BlockPublicPolicy != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy) : undefined;
const ignorePublicAclsResult = properties.IgnorePublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls) : undefined;
const restrictPublicBucketsResult = properties.RestrictPublicBuckets != null ? cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
blockPublicAcls: blockPublicAclsResult?.value,
blockPublicPolicy: blockPublicPolicyResult?.value,
ignorePublicAcls: ignorePublicAclsResult?.value,
restrictPublicBuckets: restrictPublicBucketsResult?.value,
});
ret.appendExtraProperties('BlockPublicAcls', blockPublicAclsResult?.extraProperties);
ret.appendExtraProperties('BlockPublicPolicy', blockPublicPolicyResult?.extraProperties);
ret.appendExtraProperties('IgnorePublicAcls', ignorePublicAclsResult?.extraProperties);
ret.appendExtraProperties('RestrictPublicBuckets', restrictPublicBucketsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', 'RestrictPublicBuckets'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnAccessPoint {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-vpcconfiguration.html
*/
export interface VpcConfigurationProperty {
/**
* `CfnAccessPoint.VpcConfigurationProperty.VpcId`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-accesspoint-vpcconfiguration.html#cfn-s3-accesspoint-vpcconfiguration-vpcid
*/
readonly vpcId?: string;
}
}
/**
* Determine whether the given properties match those of a `VpcConfigurationProperty`
*
* @param properties - the TypeScript properties of a `VpcConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnAccessPoint_VpcConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('vpcId', cdk.validateString)(properties.vpcId));
return errors.wrap('supplied properties not correct for "VpcConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::AccessPoint.VpcConfiguration` resource
*
* @param properties - the TypeScript properties of a `VpcConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::AccessPoint.VpcConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnAccessPointVpcConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnAccessPoint_VpcConfigurationPropertyValidator(properties).assertSuccess();
return {
VpcId: cdk.stringToCloudFormation(properties.vpcId),
};
}
// @ts-ignore TS6133
function CfnAccessPointVpcConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnAccessPoint.VpcConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const vpcIdResult = properties.VpcId != null ? cfn_parse.FromCloudFormation.getString(properties.VpcId) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
vpcId: vpcIdResult?.value,
});
ret.appendExtraProperties('VpcId', vpcIdResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'VpcId'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* 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),
};
}
// @ts-ignore TS6133
function CfnBucketPropsFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucketProps> {
properties = properties || {};
const accelerateConfigurationResult = properties.AccelerateConfiguration != null ? CfnBucketAccelerateConfigurationPropertyFromCloudFormation(properties.AccelerateConfiguration) : undefined;
const accessControlResult = properties.AccessControl != null ? cfn_parse.FromCloudFormation.getString(properties.AccessControl) : undefined;
const analyticsConfigurationsResult = properties.AnalyticsConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketAnalyticsConfigurationPropertyFromCloudFormation)(properties.AnalyticsConfigurations) : undefined;
const bucketEncryptionResult = properties.BucketEncryption != null ? CfnBucketBucketEncryptionPropertyFromCloudFormation(properties.BucketEncryption) : undefined;
const bucketNameResult = properties.BucketName != null ? cfn_parse.FromCloudFormation.getString(properties.BucketName) : undefined;
const corsConfigurationResult = properties.CorsConfiguration != null ? CfnBucketCorsConfigurationPropertyFromCloudFormation(properties.CorsConfiguration) : undefined;
const intelligentTieringConfigurationsResult = properties.IntelligentTieringConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketIntelligentTieringConfigurationPropertyFromCloudFormation)(properties.IntelligentTieringConfigurations) : undefined;
const inventoryConfigurationsResult = properties.InventoryConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketInventoryConfigurationPropertyFromCloudFormation)(properties.InventoryConfigurations) : undefined;
const lifecycleConfigurationResult = properties.LifecycleConfiguration != null ? CfnBucketLifecycleConfigurationPropertyFromCloudFormation(properties.LifecycleConfiguration) : undefined;
const loggingConfigurationResult = properties.LoggingConfiguration != null ? CfnBucketLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration) : undefined;
const metricsConfigurationsResult = properties.MetricsConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketMetricsConfigurationPropertyFromCloudFormation)(properties.MetricsConfigurations) : undefined;
const notificationConfigurationResult = properties.NotificationConfiguration != null ? CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties.NotificationConfiguration) : undefined;
const objectLockConfigurationResult = properties.ObjectLockConfiguration != null ? CfnBucketObjectLockConfigurationPropertyFromCloudFormation(properties.ObjectLockConfiguration) : undefined;
const objectLockEnabledResult = properties.ObjectLockEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.ObjectLockEnabled) : undefined;
const ownershipControlsResult = properties.OwnershipControls != null ? CfnBucketOwnershipControlsPropertyFromCloudFormation(properties.OwnershipControls) : undefined;
const publicAccessBlockConfigurationResult = properties.PublicAccessBlockConfiguration != null ? CfnBucketPublicAccessBlockConfigurationPropertyFromCloudFormation(properties.PublicAccessBlockConfiguration) : undefined;
const replicationConfigurationResult = properties.ReplicationConfiguration != null ? CfnBucketReplicationConfigurationPropertyFromCloudFormation(properties.ReplicationConfiguration) : undefined;
const tagsResult = properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined as any;
const versioningConfigurationResult = properties.VersioningConfiguration != null ? CfnBucketVersioningConfigurationPropertyFromCloudFormation(properties.VersioningConfiguration) : undefined;
const websiteConfigurationResult = properties.WebsiteConfiguration != null ? CfnBucketWebsiteConfigurationPropertyFromCloudFormation(properties.WebsiteConfiguration) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
accelerateConfiguration: accelerateConfigurationResult?.value,
accessControl: accessControlResult?.value,
analyticsConfigurations: analyticsConfigurationsResult?.value,
bucketEncryption: bucketEncryptionResult?.value,
bucketName: bucketNameResult?.value,
corsConfiguration: corsConfigurationResult?.value,
intelligentTieringConfigurations: intelligentTieringConfigurationsResult?.value,
inventoryConfigurations: inventoryConfigurationsResult?.value,
lifecycleConfiguration: lifecycleConfigurationResult?.value,
loggingConfiguration: loggingConfigurationResult?.value,
metricsConfigurations: metricsConfigurationsResult?.value,
notificationConfiguration: notificationConfigurationResult?.value,
objectLockConfiguration: objectLockConfigurationResult?.value,
objectLockEnabled: objectLockEnabledResult?.value,
ownershipControls: ownershipControlsResult?.value,
publicAccessBlockConfiguration: publicAccessBlockConfigurationResult?.value,
replicationConfiguration: replicationConfigurationResult?.value,
tags: tagsResult?.value,
versioningConfiguration: versioningConfigurationResult?.value,
websiteConfiguration: websiteConfigurationResult?.value,
});
ret.appendExtraProperties('AccelerateConfiguration', accelerateConfigurationResult?.extraProperties);
ret.appendExtraProperties('AccessControl', accessControlResult?.extraProperties);
ret.appendExtraProperties('AnalyticsConfigurations', analyticsConfigurationsResult?.extraProperties);
ret.appendExtraProperties('BucketEncryption', bucketEncryptionResult?.extraProperties);
ret.appendExtraProperties('BucketName', bucketNameResult?.extraProperties);
ret.appendExtraProperties('CorsConfiguration', corsConfigurationResult?.extraProperties);
ret.appendExtraProperties('IntelligentTieringConfigurations', intelligentTieringConfigurationsResult?.extraProperties);
ret.appendExtraProperties('InventoryConfigurations', inventoryConfigurationsResult?.extraProperties);
ret.appendExtraProperties('LifecycleConfiguration', lifecycleConfigurationResult?.extraProperties);
ret.appendExtraProperties('LoggingConfiguration', loggingConfigurationResult?.extraProperties);
ret.appendExtraProperties('MetricsConfigurations', metricsConfigurationsResult?.extraProperties);
ret.appendExtraProperties('NotificationConfiguration', notificationConfigurationResult?.extraProperties);
ret.appendExtraProperties('ObjectLockConfiguration', objectLockConfigurationResult?.extraProperties);
ret.appendExtraProperties('ObjectLockEnabled', objectLockEnabledResult?.extraProperties);
ret.appendExtraProperties('OwnershipControls', ownershipControlsResult?.extraProperties);
ret.appendExtraProperties('PublicAccessBlockConfiguration', publicAccessBlockConfigurationResult?.extraProperties);
ret.appendExtraProperties('ReplicationConfiguration', replicationConfigurationResult?.extraProperties);
ret.appendExtraProperties('Tags', tagsResult?.extraProperties);
ret.appendExtraProperties('VersioningConfiguration', versioningConfigurationResult?.extraProperties);
ret.appendExtraProperties('WebsiteConfiguration', websiteConfigurationResult?.extraProperties);
for (const [key, val] of Object.entries(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'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* 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 propsResult = CfnBucketPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucket(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
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,
};
}
protected renderProperties(props: {[key: string]: any}): { [key: string]: any } {
return cfnBucketPropsToCloudFormation(props);
}
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html
*/
export interface AbortIncompleteMultipartUploadProperty {
/**
* `CfnBucket.AbortIncompleteMultipartUploadProperty.DaysAfterInitiation`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-abortincompletemultipartupload.html#cfn-s3-bucket-abortincompletemultipartupload-daysafterinitiation
*/
readonly daysAfterInitiation: number;
}
}
/**
* Determine whether the given properties match those of a `AbortIncompleteMultipartUploadProperty`
*
* @param properties - the TypeScript properties of a `AbortIncompleteMultipartUploadProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AbortIncompleteMultipartUploadPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.requiredValidator)(properties.daysAfterInitiation));
errors.collect(cdk.propertyValidator('daysAfterInitiation', cdk.validateNumber)(properties.daysAfterInitiation));
return errors.wrap('supplied properties not correct for "AbortIncompleteMultipartUploadProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AbortIncompleteMultipartUpload` resource
*
* @param properties - the TypeScript properties of a `AbortIncompleteMultipartUploadProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AbortIncompleteMultipartUpload` resource.
*/
// @ts-ignore TS6133
function cfnBucketAbortIncompleteMultipartUploadPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AbortIncompleteMultipartUploadPropertyValidator(properties).assertSuccess();
return {
DaysAfterInitiation: cdk.numberToCloudFormation(properties.daysAfterInitiation),
};
}
// @ts-ignore TS6133
function CfnBucketAbortIncompleteMultipartUploadPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.AbortIncompleteMultipartUploadProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const daysAfterInitiationResult = cfn_parse.FromCloudFormation.getNumber(properties.DaysAfterInitiation);
const ret = new cfn_parse.FromCloudFormationResult({
daysAfterInitiation: daysAfterInitiationResult?.value,
});
ret.appendExtraProperties('DaysAfterInitiation', daysAfterInitiationResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'DaysAfterInitiation'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accelerateconfiguration.html
*/
export interface AccelerateConfigurationProperty {
/**
* `CfnBucket.AccelerateConfigurationProperty.AccelerationStatus`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accelerateconfiguration.html#cfn-s3-bucket-accelerateconfiguration-accelerationstatus
*/
readonly accelerationStatus: string;
}
}
/**
* Determine whether the given properties match those of a `AccelerateConfigurationProperty`
*
* @param properties - the TypeScript properties of a `AccelerateConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AccelerateConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('accelerationStatus', cdk.requiredValidator)(properties.accelerationStatus));
errors.collect(cdk.propertyValidator('accelerationStatus', cdk.validateString)(properties.accelerationStatus));
return errors.wrap('supplied properties not correct for "AccelerateConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AccelerateConfiguration` resource
*
* @param properties - the TypeScript properties of a `AccelerateConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AccelerateConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketAccelerateConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AccelerateConfigurationPropertyValidator(properties).assertSuccess();
return {
AccelerationStatus: cdk.stringToCloudFormation(properties.accelerationStatus),
};
}
// @ts-ignore TS6133
function CfnBucketAccelerateConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.AccelerateConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const accelerationStatusResult = cfn_parse.FromCloudFormation.getString(properties.AccelerationStatus);
const ret = new cfn_parse.FromCloudFormationResult({
accelerationStatus: accelerationStatusResult?.value,
});
ret.appendExtraProperties('AccelerationStatus', accelerationStatusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AccelerationStatus'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html
*/
export interface AccessControlTranslationProperty {
/**
* `CfnBucket.AccessControlTranslationProperty.Owner`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html#cfn-s3-bucket-accesscontroltranslation-owner
*/
readonly owner: string;
}
}
/**
* Determine whether the given properties match those of a `AccessControlTranslationProperty`
*
* @param properties - the TypeScript properties of a `AccessControlTranslationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AccessControlTranslationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('owner', cdk.requiredValidator)(properties.owner));
errors.collect(cdk.propertyValidator('owner', cdk.validateString)(properties.owner));
return errors.wrap('supplied properties not correct for "AccessControlTranslationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AccessControlTranslation` resource
*
* @param properties - the TypeScript properties of a `AccessControlTranslationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AccessControlTranslation` resource.
*/
// @ts-ignore TS6133
function cfnBucketAccessControlTranslationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AccessControlTranslationPropertyValidator(properties).assertSuccess();
return {
Owner: cdk.stringToCloudFormation(properties.owner),
};
}
// @ts-ignore TS6133
function CfnBucketAccessControlTranslationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.AccessControlTranslationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const ownerResult = cfn_parse.FromCloudFormation.getString(properties.Owner);
const ret = new cfn_parse.FromCloudFormationResult({
owner: ownerResult?.value,
});
ret.appendExtraProperties('Owner', ownerResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Owner'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html
*/
export interface AnalyticsConfigurationProperty {
/**
* `CfnBucket.AnalyticsConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.AnalyticsConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.AnalyticsConfigurationProperty.StorageClassAnalysis`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-storageclassanalysis
*/
readonly storageClassAnalysis: CfnBucket.StorageClassAnalysisProperty | cdk.IResolvable;
/**
* `CfnBucket.AnalyticsConfigurationProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-analyticsconfiguration.html#cfn-s3-bucket-analyticsconfiguration-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `AnalyticsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `AnalyticsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_AnalyticsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('storageClassAnalysis', cdk.requiredValidator)(properties.storageClassAnalysis));
errors.collect(cdk.propertyValidator('storageClassAnalysis', CfnBucket_StorageClassAnalysisPropertyValidator)(properties.storageClassAnalysis));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
return errors.wrap('supplied properties not correct for "AnalyticsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.AnalyticsConfiguration` resource
*
* @param properties - the TypeScript properties of a `AnalyticsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.AnalyticsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketAnalyticsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_AnalyticsConfigurationPropertyValidator(properties).assertSuccess();
return {
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
StorageClassAnalysis: cfnBucketStorageClassAnalysisPropertyToCloudFormation(properties.storageClassAnalysis),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
};
}
// @ts-ignore TS6133
function CfnBucketAnalyticsConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.AnalyticsConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const idResult = cfn_parse.FromCloudFormation.getString(properties.Id);
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const storageClassAnalysisResult = CfnBucketStorageClassAnalysisPropertyFromCloudFormation(properties.StorageClassAnalysis);
const tagFiltersResult = properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
id: idResult?.value,
prefix: prefixResult?.value,
storageClassAnalysis: storageClassAnalysisResult?.value,
tagFilters: tagFiltersResult?.value,
});
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('StorageClassAnalysis', storageClassAnalysisResult?.extraProperties);
ret.appendExtraProperties('TagFilters', tagFiltersResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'StorageClassAnalysis', 'TagFilters'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-bucketencryption.html
*/
export interface BucketEncryptionProperty {
/**
* `CfnBucket.BucketEncryptionProperty.ServerSideEncryptionConfiguration`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-bucketencryption.html#cfn-s3-bucket-bucketencryption-serversideencryptionconfiguration
*/
readonly serverSideEncryptionConfiguration: Array<CfnBucket.ServerSideEncryptionRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `BucketEncryptionProperty`
*
* @param properties - the TypeScript properties of a `BucketEncryptionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_BucketEncryptionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.requiredValidator)(properties.serverSideEncryptionConfiguration));
errors.collect(cdk.propertyValidator('serverSideEncryptionConfiguration', cdk.listValidator(CfnBucket_ServerSideEncryptionRulePropertyValidator))(properties.serverSideEncryptionConfiguration));
return errors.wrap('supplied properties not correct for "BucketEncryptionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.BucketEncryption` resource
*
* @param properties - the TypeScript properties of a `BucketEncryptionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.BucketEncryption` resource.
*/
// @ts-ignore TS6133
function cfnBucketBucketEncryptionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_BucketEncryptionPropertyValidator(properties).assertSuccess();
return {
ServerSideEncryptionConfiguration: cdk.listMapper(cfnBucketServerSideEncryptionRulePropertyToCloudFormation)(properties.serverSideEncryptionConfiguration),
};
}
// @ts-ignore TS6133
function CfnBucketBucketEncryptionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.BucketEncryptionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const serverSideEncryptionConfigurationResult = cfn_parse.FromCloudFormation.getArray(CfnBucketServerSideEncryptionRulePropertyFromCloudFormation)(properties.ServerSideEncryptionConfiguration);
const ret = new cfn_parse.FromCloudFormationResult({
serverSideEncryptionConfiguration: serverSideEncryptionConfigurationResult?.value,
});
ret.appendExtraProperties('ServerSideEncryptionConfiguration', serverSideEncryptionConfigurationResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ServerSideEncryptionConfiguration'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html
*/
export interface CorsConfigurationProperty {
/**
* `CfnBucket.CorsConfigurationProperty.CorsRules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html#cfn-s3-bucket-cors-corsrule
*/
readonly corsRules: Array<CfnBucket.CorsRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `CorsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `CorsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_CorsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('corsRules', cdk.requiredValidator)(properties.corsRules));
errors.collect(cdk.propertyValidator('corsRules', cdk.listValidator(CfnBucket_CorsRulePropertyValidator))(properties.corsRules));
return errors.wrap('supplied properties not correct for "CorsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsConfiguration` resource
*
* @param properties - the TypeScript properties of a `CorsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketCorsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_CorsConfigurationPropertyValidator(properties).assertSuccess();
return {
CorsRules: cdk.listMapper(cfnBucketCorsRulePropertyToCloudFormation)(properties.corsRules),
};
}
// @ts-ignore TS6133
function CfnBucketCorsConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.CorsConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const corsRulesResult = cfn_parse.FromCloudFormation.getArray(CfnBucketCorsRulePropertyFromCloudFormation)(properties.CorsRules);
const ret = new cfn_parse.FromCloudFormationResult({
corsRules: corsRulesResult?.value,
});
ret.appendExtraProperties('CorsRules', corsRulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'CorsRules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html
*/
export interface CorsRuleProperty {
/**
* `CfnBucket.CorsRuleProperty.AllowedHeaders`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedheaders
*/
readonly allowedHeaders?: string[];
/**
* `CfnBucket.CorsRuleProperty.AllowedMethods`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedmethods
*/
readonly allowedMethods: string[];
/**
* `CfnBucket.CorsRuleProperty.AllowedOrigins`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedorigins
*/
readonly allowedOrigins: string[];
/**
* `CfnBucket.CorsRuleProperty.ExposedHeaders`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-exposedheaders
*/
readonly exposedHeaders?: string[];
/**
* `CfnBucket.CorsRuleProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-id
*/
readonly id?: string;
/**
* `CfnBucket.CorsRuleProperty.MaxAge`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-maxage
*/
readonly maxAge?: number;
}
}
/**
* Determine whether the given properties match those of a `CorsRuleProperty`
*
* @param properties - the TypeScript properties of a `CorsRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_CorsRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('allowedHeaders', cdk.listValidator(cdk.validateString))(properties.allowedHeaders));
errors.collect(cdk.propertyValidator('allowedMethods', cdk.requiredValidator)(properties.allowedMethods));
errors.collect(cdk.propertyValidator('allowedMethods', cdk.listValidator(cdk.validateString))(properties.allowedMethods));
errors.collect(cdk.propertyValidator('allowedOrigins', cdk.requiredValidator)(properties.allowedOrigins));
errors.collect(cdk.propertyValidator('allowedOrigins', cdk.listValidator(cdk.validateString))(properties.allowedOrigins));
errors.collect(cdk.propertyValidator('exposedHeaders', cdk.listValidator(cdk.validateString))(properties.exposedHeaders));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('maxAge', cdk.validateNumber)(properties.maxAge));
return errors.wrap('supplied properties not correct for "CorsRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsRule` resource
*
* @param properties - the TypeScript properties of a `CorsRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.CorsRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketCorsRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_CorsRulePropertyValidator(properties).assertSuccess();
return {
AllowedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedHeaders),
AllowedMethods: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedMethods),
AllowedOrigins: cdk.listMapper(cdk.stringToCloudFormation)(properties.allowedOrigins),
ExposedHeaders: cdk.listMapper(cdk.stringToCloudFormation)(properties.exposedHeaders),
Id: cdk.stringToCloudFormation(properties.id),
MaxAge: cdk.numberToCloudFormation(properties.maxAge),
};
}
// @ts-ignore TS6133
function CfnBucketCorsRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.CorsRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const allowedHeadersResult = properties.AllowedHeaders != null ? cfn_parse.FromCloudFormation.getStringArray(properties.AllowedHeaders) : undefined;
const allowedMethodsResult = cfn_parse.FromCloudFormation.getStringArray(properties.AllowedMethods);
const allowedOriginsResult = cfn_parse.FromCloudFormation.getStringArray(properties.AllowedOrigins);
const exposedHeadersResult = properties.ExposedHeaders != null ? cfn_parse.FromCloudFormation.getStringArray(properties.ExposedHeaders) : undefined;
const idResult = properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined;
const maxAgeResult = properties.MaxAge != null ? cfn_parse.FromCloudFormation.getNumber(properties.MaxAge) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
allowedHeaders: allowedHeadersResult?.value,
allowedMethods: allowedMethodsResult?.value,
allowedOrigins: allowedOriginsResult?.value,
exposedHeaders: exposedHeadersResult?.value,
id: idResult?.value,
maxAge: maxAgeResult?.value,
});
ret.appendExtraProperties('AllowedHeaders', allowedHeadersResult?.extraProperties);
ret.appendExtraProperties('AllowedMethods', allowedMethodsResult?.extraProperties);
ret.appendExtraProperties('AllowedOrigins', allowedOriginsResult?.extraProperties);
ret.appendExtraProperties('ExposedHeaders', exposedHeadersResult?.extraProperties);
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('MaxAge', maxAgeResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AllowedHeaders', 'AllowedMethods', 'AllowedOrigins', 'ExposedHeaders', 'Id', 'MaxAge'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html
*/
export interface DataExportProperty {
/**
* `CfnBucket.DataExportProperty.Destination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-destination
*/
readonly destination: CfnBucket.DestinationProperty | cdk.IResolvable;
/**
* `CfnBucket.DataExportProperty.OutputSchemaVersion`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-dataexport.html#cfn-s3-bucket-dataexport-outputschemaversion
*/
readonly outputSchemaVersion: string;
}
}
/**
* Determine whether the given properties match those of a `DataExportProperty`
*
* @param properties - the TypeScript properties of a `DataExportProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DataExportPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_DestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.requiredValidator)(properties.outputSchemaVersion));
errors.collect(cdk.propertyValidator('outputSchemaVersion', cdk.validateString)(properties.outputSchemaVersion));
return errors.wrap('supplied properties not correct for "DataExportProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.DataExport` resource
*
* @param properties - the TypeScript properties of a `DataExportProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.DataExport` resource.
*/
// @ts-ignore TS6133
function cfnBucketDataExportPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DataExportPropertyValidator(properties).assertSuccess();
return {
Destination: cfnBucketDestinationPropertyToCloudFormation(properties.destination),
OutputSchemaVersion: cdk.stringToCloudFormation(properties.outputSchemaVersion),
};
}
// @ts-ignore TS6133
function CfnBucketDataExportPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.DataExportProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const destinationResult = CfnBucketDestinationPropertyFromCloudFormation(properties.Destination);
const outputSchemaVersionResult = cfn_parse.FromCloudFormation.getString(properties.OutputSchemaVersion);
const ret = new cfn_parse.FromCloudFormationResult({
destination: destinationResult?.value,
outputSchemaVersion: outputSchemaVersionResult?.value,
});
ret.appendExtraProperties('Destination', destinationResult?.extraProperties);
ret.appendExtraProperties('OutputSchemaVersion', outputSchemaVersionResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Destination', 'OutputSchemaVersion'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html
*/
export interface DefaultRetentionProperty {
/**
* `CfnBucket.DefaultRetentionProperty.Days`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-days
*/
readonly days?: number;
/**
* `CfnBucket.DefaultRetentionProperty.Mode`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-mode
*/
readonly mode?: string;
/**
* `CfnBucket.DefaultRetentionProperty.Years`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-defaultretention.html#cfn-s3-bucket-defaultretention-years
*/
readonly years?: number;
}
}
/**
* Determine whether the given properties match those of a `DefaultRetentionProperty`
*
* @param properties - the TypeScript properties of a `DefaultRetentionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DefaultRetentionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('days', cdk.validateNumber)(properties.days));
errors.collect(cdk.propertyValidator('mode', cdk.validateString)(properties.mode));
errors.collect(cdk.propertyValidator('years', cdk.validateNumber)(properties.years));
return errors.wrap('supplied properties not correct for "DefaultRetentionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.DefaultRetention` resource
*
* @param properties - the TypeScript properties of a `DefaultRetentionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.DefaultRetention` resource.
*/
// @ts-ignore TS6133
function cfnBucketDefaultRetentionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DefaultRetentionPropertyValidator(properties).assertSuccess();
return {
Days: cdk.numberToCloudFormation(properties.days),
Mode: cdk.stringToCloudFormation(properties.mode),
Years: cdk.numberToCloudFormation(properties.years),
};
}
// @ts-ignore TS6133
function CfnBucketDefaultRetentionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.DefaultRetentionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const daysResult = properties.Days != null ? cfn_parse.FromCloudFormation.getNumber(properties.Days) : undefined;
const modeResult = properties.Mode != null ? cfn_parse.FromCloudFormation.getString(properties.Mode) : undefined;
const yearsResult = properties.Years != null ? cfn_parse.FromCloudFormation.getNumber(properties.Years) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
days: daysResult?.value,
mode: modeResult?.value,
years: yearsResult?.value,
});
ret.appendExtraProperties('Days', daysResult?.extraProperties);
ret.appendExtraProperties('Mode', modeResult?.extraProperties);
ret.appendExtraProperties('Years', yearsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Days', 'Mode', 'Years'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketDeleteMarkerReplicationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.DeleteMarkerReplicationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const statusResult = properties.Status != null ? cfn_parse.FromCloudFormation.getString(properties.Status) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
status: statusResult?.value,
});
ret.appendExtraProperties('Status', statusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Status'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html
*/
export interface DestinationProperty {
/**
* `CfnBucket.DestinationProperty.BucketAccountId`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketaccountid
*/
readonly bucketAccountId?: string;
/**
* `CfnBucket.DestinationProperty.BucketArn`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-bucketarn
*/
readonly bucketArn: string;
/**
* `CfnBucket.DestinationProperty.Format`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-format
*/
readonly format: string;
/**
* `CfnBucket.DestinationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-destination.html#cfn-s3-bucket-destination-prefix
*/
readonly prefix?: string;
}
}
/**
* Determine whether the given properties match those of a `DestinationProperty`
*
* @param properties - the TypeScript properties of a `DestinationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_DestinationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('bucketAccountId', cdk.validateString)(properties.bucketAccountId));
errors.collect(cdk.propertyValidator('bucketArn', cdk.requiredValidator)(properties.bucketArn));
errors.collect(cdk.propertyValidator('bucketArn', cdk.validateString)(properties.bucketArn));
errors.collect(cdk.propertyValidator('format', cdk.requiredValidator)(properties.format));
errors.collect(cdk.propertyValidator('format', cdk.validateString)(properties.format));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
return errors.wrap('supplied properties not correct for "DestinationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Destination` resource
*
* @param properties - the TypeScript properties of a `DestinationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Destination` resource.
*/
// @ts-ignore TS6133
function cfnBucketDestinationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_DestinationPropertyValidator(properties).assertSuccess();
return {
BucketAccountId: cdk.stringToCloudFormation(properties.bucketAccountId),
BucketArn: cdk.stringToCloudFormation(properties.bucketArn),
Format: cdk.stringToCloudFormation(properties.format),
Prefix: cdk.stringToCloudFormation(properties.prefix),
};
}
// @ts-ignore TS6133
function CfnBucketDestinationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.DestinationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const bucketAccountIdResult = properties.BucketAccountId != null ? cfn_parse.FromCloudFormation.getString(properties.BucketAccountId) : undefined;
const bucketArnResult = cfn_parse.FromCloudFormation.getString(properties.BucketArn);
const formatResult = cfn_parse.FromCloudFormation.getString(properties.Format);
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
bucketAccountId: bucketAccountIdResult?.value,
bucketArn: bucketArnResult?.value,
format: formatResult?.value,
prefix: prefixResult?.value,
});
ret.appendExtraProperties('BucketAccountId', bucketAccountIdResult?.extraProperties);
ret.appendExtraProperties('BucketArn', bucketArnResult?.extraProperties);
ret.appendExtraProperties('Format', formatResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'BucketAccountId', 'BucketArn', 'Format', 'Prefix'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-encryptionconfiguration.html
*/
export interface EncryptionConfigurationProperty {
/**
* `CfnBucket.EncryptionConfigurationProperty.ReplicaKmsKeyID`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-encryptionconfiguration.html#cfn-s3-bucket-encryptionconfiguration-replicakmskeyid
*/
readonly replicaKmsKeyId: string;
}
}
/**
* Determine whether the given properties match those of a `EncryptionConfigurationProperty`
*
* @param properties - the TypeScript properties of a `EncryptionConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_EncryptionConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.requiredValidator)(properties.replicaKmsKeyId));
errors.collect(cdk.propertyValidator('replicaKmsKeyId', cdk.validateString)(properties.replicaKmsKeyId));
return errors.wrap('supplied properties not correct for "EncryptionConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.EncryptionConfiguration` resource
*
* @param properties - the TypeScript properties of a `EncryptionConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.EncryptionConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketEncryptionConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_EncryptionConfigurationPropertyValidator(properties).assertSuccess();
return {
ReplicaKmsKeyID: cdk.stringToCloudFormation(properties.replicaKmsKeyId),
};
}
// @ts-ignore TS6133
function CfnBucketEncryptionConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.EncryptionConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const replicaKmsKeyIdResult = cfn_parse.FromCloudFormation.getString(properties.ReplicaKmsKeyID);
const ret = new cfn_parse.FromCloudFormationResult({
replicaKmsKeyId: replicaKmsKeyIdResult?.value,
});
ret.appendExtraProperties('ReplicaKmsKeyID', replicaKmsKeyIdResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ReplicaKmsKeyID'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html
*/
export interface FilterRuleProperty {
/**
* `CfnBucket.FilterRuleProperty.Name`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-name
*/
readonly name: string;
/**
* `CfnBucket.FilterRuleProperty.Value`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key-rules.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules-value
*/
readonly value: string;
}
}
/**
* Determine whether the given properties match those of a `FilterRuleProperty`
*
* @param properties - the TypeScript properties of a `FilterRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_FilterRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('name', cdk.requiredValidator)(properties.name));
errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));
errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
return errors.wrap('supplied properties not correct for "FilterRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.FilterRule` resource
*
* @param properties - the TypeScript properties of a `FilterRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.FilterRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketFilterRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_FilterRulePropertyValidator(properties).assertSuccess();
return {
Name: cdk.stringToCloudFormation(properties.name),
Value: cdk.stringToCloudFormation(properties.value),
};
}
// @ts-ignore TS6133
function CfnBucketFilterRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.FilterRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const nameResult = cfn_parse.FromCloudFormation.getString(properties.Name);
const valueResult = cfn_parse.FromCloudFormation.getString(properties.Value);
const ret = new cfn_parse.FromCloudFormationResult({
name: nameResult?.value,
value: valueResult?.value,
});
ret.appendExtraProperties('Name', nameResult?.extraProperties);
ret.appendExtraProperties('Value', valueResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Name', 'Value'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketIntelligentTieringConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.IntelligentTieringConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const idResult = cfn_parse.FromCloudFormation.getString(properties.Id);
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const tagFiltersResult = properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined;
const tieringsResult = cfn_parse.FromCloudFormation.getArray(CfnBucketTieringPropertyFromCloudFormation)(properties.Tierings);
const ret = new cfn_parse.FromCloudFormationResult({
id: idResult?.value,
prefix: prefixResult?.value,
status: statusResult?.value,
tagFilters: tagFiltersResult?.value,
tierings: tieringsResult?.value,
});
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('Status', statusResult?.extraProperties);
ret.appendExtraProperties('TagFilters', tagFiltersResult?.extraProperties);
ret.appendExtraProperties('Tierings', tieringsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'Status', 'TagFilters', 'Tierings'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html
*/
export interface InventoryConfigurationProperty {
/**
* `CfnBucket.InventoryConfigurationProperty.Destination`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-destination
*/
readonly destination: CfnBucket.DestinationProperty | cdk.IResolvable;
/**
* `CfnBucket.InventoryConfigurationProperty.Enabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-enabled
*/
readonly enabled: boolean | cdk.IResolvable;
/**
* `CfnBucket.InventoryConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.InventoryConfigurationProperty.IncludedObjectVersions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-includedobjectversions
*/
readonly includedObjectVersions: string;
/**
* `CfnBucket.InventoryConfigurationProperty.OptionalFields`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-optionalfields
*/
readonly optionalFields?: string[];
/**
* `CfnBucket.InventoryConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.InventoryConfigurationProperty.ScheduleFrequency`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-inventoryconfiguration.html#cfn-s3-bucket-inventoryconfiguration-schedulefrequency
*/
readonly scheduleFrequency: string;
}
}
/**
* Determine whether the given properties match those of a `InventoryConfigurationProperty`
*
* @param properties - the TypeScript properties of a `InventoryConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_InventoryConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destination', cdk.requiredValidator)(properties.destination));
errors.collect(cdk.propertyValidator('destination', CfnBucket_DestinationPropertyValidator)(properties.destination));
errors.collect(cdk.propertyValidator('enabled', cdk.requiredValidator)(properties.enabled));
errors.collect(cdk.propertyValidator('enabled', cdk.validateBoolean)(properties.enabled));
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.requiredValidator)(properties.includedObjectVersions));
errors.collect(cdk.propertyValidator('includedObjectVersions', cdk.validateString)(properties.includedObjectVersions));
errors.collect(cdk.propertyValidator('optionalFields', cdk.listValidator(cdk.validateString))(properties.optionalFields));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.requiredValidator)(properties.scheduleFrequency));
errors.collect(cdk.propertyValidator('scheduleFrequency', cdk.validateString)(properties.scheduleFrequency));
return errors.wrap('supplied properties not correct for "InventoryConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.InventoryConfiguration` resource
*
* @param properties - the TypeScript properties of a `InventoryConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.InventoryConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketInventoryConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_InventoryConfigurationPropertyValidator(properties).assertSuccess();
return {
Destination: cfnBucketDestinationPropertyToCloudFormation(properties.destination),
Enabled: cdk.booleanToCloudFormation(properties.enabled),
Id: cdk.stringToCloudFormation(properties.id),
IncludedObjectVersions: cdk.stringToCloudFormation(properties.includedObjectVersions),
OptionalFields: cdk.listMapper(cdk.stringToCloudFormation)(properties.optionalFields),
Prefix: cdk.stringToCloudFormation(properties.prefix),
ScheduleFrequency: cdk.stringToCloudFormation(properties.scheduleFrequency),
};
}
// @ts-ignore TS6133
function CfnBucketInventoryConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.InventoryConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const destinationResult = CfnBucketDestinationPropertyFromCloudFormation(properties.Destination);
const enabledResult = cfn_parse.FromCloudFormation.getBoolean(properties.Enabled);
const idResult = cfn_parse.FromCloudFormation.getString(properties.Id);
const includedObjectVersionsResult = cfn_parse.FromCloudFormation.getString(properties.IncludedObjectVersions);
const optionalFieldsResult = properties.OptionalFields != null ? cfn_parse.FromCloudFormation.getStringArray(properties.OptionalFields) : undefined;
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const scheduleFrequencyResult = cfn_parse.FromCloudFormation.getString(properties.ScheduleFrequency);
const ret = new cfn_parse.FromCloudFormationResult({
destination: destinationResult?.value,
enabled: enabledResult?.value,
id: idResult?.value,
includedObjectVersions: includedObjectVersionsResult?.value,
optionalFields: optionalFieldsResult?.value,
prefix: prefixResult?.value,
scheduleFrequency: scheduleFrequencyResult?.value,
});
ret.appendExtraProperties('Destination', destinationResult?.extraProperties);
ret.appendExtraProperties('Enabled', enabledResult?.extraProperties);
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('IncludedObjectVersions', includedObjectVersionsResult?.extraProperties);
ret.appendExtraProperties('OptionalFields', optionalFieldsResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('ScheduleFrequency', scheduleFrequencyResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Destination', 'Enabled', 'Id', 'IncludedObjectVersions', 'OptionalFields', 'Prefix', 'ScheduleFrequency'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html
*/
export interface LambdaConfigurationProperty {
/**
* `CfnBucket.LambdaConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-event
*/
readonly event: string;
/**
* `CfnBucket.LambdaConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.LambdaConfigurationProperty.Function`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-lambdaconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig-function
*/
readonly function: string;
}
}
/**
* Determine whether the given properties match those of a `LambdaConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LambdaConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LambdaConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('function', cdk.requiredValidator)(properties.function));
errors.collect(cdk.propertyValidator('function', cdk.validateString)(properties.function));
return errors.wrap('supplied properties not correct for "LambdaConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LambdaConfiguration` resource
*
* @param properties - the TypeScript properties of a `LambdaConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LambdaConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLambdaConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LambdaConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Function: cdk.stringToCloudFormation(properties.function),
};
}
// @ts-ignore TS6133
function CfnBucketLambdaConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.LambdaConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const eventResult = cfn_parse.FromCloudFormation.getString(properties.Event);
const filterResult = properties.Filter != null ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined;
const functionResult = cfn_parse.FromCloudFormation.getString(properties.Function);
const ret = new cfn_parse.FromCloudFormationResult({
event: eventResult?.value,
filter: filterResult?.value,
function: functionResult?.value,
});
ret.appendExtraProperties('Event', eventResult?.extraProperties);
ret.appendExtraProperties('Filter', filterResult?.extraProperties);
ret.appendExtraProperties('Function', functionResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', 'Function'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig.html
*/
export interface LifecycleConfigurationProperty {
/**
* `CfnBucket.LifecycleConfigurationProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig.html#cfn-s3-bucket-lifecycleconfig-rules
*/
readonly rules: Array<CfnBucket.RuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `LifecycleConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LifecycleConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LifecycleConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_RulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "LifecycleConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LifecycleConfiguration` resource
*
* @param properties - the TypeScript properties of a `LifecycleConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LifecycleConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLifecycleConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LifecycleConfigurationPropertyValidator(properties).assertSuccess();
return {
Rules: cdk.listMapper(cfnBucketRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketLifecycleConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.LifecycleConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const rulesResult = cfn_parse.FromCloudFormation.getArray(CfnBucketRulePropertyFromCloudFormation)(properties.Rules);
const ret = new cfn_parse.FromCloudFormationResult({
rules: rulesResult?.value,
});
ret.appendExtraProperties('Rules', rulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Rules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html
*/
export interface LoggingConfigurationProperty {
/**
* `CfnBucket.LoggingConfigurationProperty.DestinationBucketName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-destinationbucketname
*/
readonly destinationBucketName?: string;
/**
* `CfnBucket.LoggingConfigurationProperty.LogFilePrefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-loggingconfig.html#cfn-s3-bucket-loggingconfig-logfileprefix
*/
readonly logFilePrefix?: string;
}
}
/**
* Determine whether the given properties match those of a `LoggingConfigurationProperty`
*
* @param properties - the TypeScript properties of a `LoggingConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_LoggingConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('destinationBucketName', cdk.validateString)(properties.destinationBucketName));
errors.collect(cdk.propertyValidator('logFilePrefix', cdk.validateString)(properties.logFilePrefix));
return errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.LoggingConfiguration` resource
*
* @param properties - the TypeScript properties of a `LoggingConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.LoggingConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketLoggingConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_LoggingConfigurationPropertyValidator(properties).assertSuccess();
return {
DestinationBucketName: cdk.stringToCloudFormation(properties.destinationBucketName),
LogFilePrefix: cdk.stringToCloudFormation(properties.logFilePrefix),
};
}
// @ts-ignore TS6133
function CfnBucketLoggingConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.LoggingConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const destinationBucketNameResult = properties.DestinationBucketName != null ? cfn_parse.FromCloudFormation.getString(properties.DestinationBucketName) : undefined;
const logFilePrefixResult = properties.LogFilePrefix != null ? cfn_parse.FromCloudFormation.getString(properties.LogFilePrefix) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
destinationBucketName: destinationBucketNameResult?.value,
logFilePrefix: logFilePrefixResult?.value,
});
ret.appendExtraProperties('DestinationBucketName', destinationBucketNameResult?.extraProperties);
ret.appendExtraProperties('LogFilePrefix', logFilePrefixResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'DestinationBucketName', 'LogFilePrefix'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketMetricsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.MetricsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const eventThresholdResult = properties.EventThreshold != null ? CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties.EventThreshold) : undefined;
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const ret = new cfn_parse.FromCloudFormationResult({
eventThreshold: eventThresholdResult?.value,
status: statusResult?.value,
});
ret.appendExtraProperties('EventThreshold', eventThresholdResult?.extraProperties);
ret.appendExtraProperties('Status', statusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'EventThreshold', 'Status'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html
*/
export interface MetricsConfigurationProperty {
/**
* `CfnBucket.MetricsConfigurationProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-id
*/
readonly id: string;
/**
* `CfnBucket.MetricsConfigurationProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.MetricsConfigurationProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html#cfn-s3-bucket-metricsconfiguration-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `MetricsConfigurationProperty`
*
* @param properties - the TypeScript properties of a `MetricsConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_MetricsConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('id', cdk.requiredValidator)(properties.id));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
return errors.wrap('supplied properties not correct for "MetricsConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.MetricsConfiguration` resource
*
* @param properties - the TypeScript properties of a `MetricsConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.MetricsConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketMetricsConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_MetricsConfigurationPropertyValidator(properties).assertSuccess();
return {
Id: cdk.stringToCloudFormation(properties.id),
Prefix: cdk.stringToCloudFormation(properties.prefix),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
};
}
// @ts-ignore TS6133
function CfnBucketMetricsConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.MetricsConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const idResult = cfn_parse.FromCloudFormation.getString(properties.Id);
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const tagFiltersResult = properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
id: idResult?.value,
prefix: prefixResult?.value,
tagFilters: tagFiltersResult?.value,
});
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('TagFilters', tagFiltersResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Id', 'Prefix', 'TagFilters'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html
*/
export interface NoncurrentVersionTransitionProperty {
/**
* `CfnBucket.NoncurrentVersionTransitionProperty.StorageClass`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-storageclass
*/
readonly storageClass: string;
/**
* `CfnBucket.NoncurrentVersionTransitionProperty.TransitionInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition-transitionindays
*/
readonly transitionInDays: number;
}
}
/**
* Determine whether the given properties match those of a `NoncurrentVersionTransitionProperty`
*
* @param properties - the TypeScript properties of a `NoncurrentVersionTransitionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NoncurrentVersionTransitionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.requiredValidator)(properties.transitionInDays));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
return errors.wrap('supplied properties not correct for "NoncurrentVersionTransitionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NoncurrentVersionTransition` resource
*
* @param properties - the TypeScript properties of a `NoncurrentVersionTransitionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NoncurrentVersionTransition` resource.
*/
// @ts-ignore TS6133
function cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NoncurrentVersionTransitionPropertyValidator(properties).assertSuccess();
return {
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
};
}
// @ts-ignore TS6133
function CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const storageClassResult = cfn_parse.FromCloudFormation.getString(properties.StorageClass);
const transitionInDaysResult = cfn_parse.FromCloudFormation.getNumber(properties.TransitionInDays);
const ret = new cfn_parse.FromCloudFormationResult({
storageClass: storageClassResult?.value,
transitionInDays: transitionInDaysResult?.value,
});
ret.appendExtraProperties('StorageClass', storageClassResult?.extraProperties);
ret.appendExtraProperties('TransitionInDays', transitionInDaysResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'StorageClass', 'TransitionInDays'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html
*/
export interface NotificationConfigurationProperty {
/**
* `CfnBucket.NotificationConfigurationProperty.LambdaConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-lambdaconfig
*/
readonly lambdaConfigurations?: Array<CfnBucket.LambdaConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.NotificationConfigurationProperty.QueueConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-queueconfig
*/
readonly queueConfigurations?: Array<CfnBucket.QueueConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.NotificationConfigurationProperty.TopicConfigurations`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig.html#cfn-s3-bucket-notificationconfig-topicconfig
*/
readonly topicConfigurations?: Array<CfnBucket.TopicConfigurationProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `NotificationConfigurationProperty`
*
* @param properties - the TypeScript properties of a `NotificationConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NotificationConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('lambdaConfigurations', cdk.listValidator(CfnBucket_LambdaConfigurationPropertyValidator))(properties.lambdaConfigurations));
errors.collect(cdk.propertyValidator('queueConfigurations', cdk.listValidator(CfnBucket_QueueConfigurationPropertyValidator))(properties.queueConfigurations));
errors.collect(cdk.propertyValidator('topicConfigurations', cdk.listValidator(CfnBucket_TopicConfigurationPropertyValidator))(properties.topicConfigurations));
return errors.wrap('supplied properties not correct for "NotificationConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationConfiguration` resource
*
* @param properties - the TypeScript properties of a `NotificationConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketNotificationConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NotificationConfigurationPropertyValidator(properties).assertSuccess();
return {
LambdaConfigurations: cdk.listMapper(cfnBucketLambdaConfigurationPropertyToCloudFormation)(properties.lambdaConfigurations),
QueueConfigurations: cdk.listMapper(cfnBucketQueueConfigurationPropertyToCloudFormation)(properties.queueConfigurations),
TopicConfigurations: cdk.listMapper(cfnBucketTopicConfigurationPropertyToCloudFormation)(properties.topicConfigurations),
};
}
// @ts-ignore TS6133
function CfnBucketNotificationConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.NotificationConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const lambdaConfigurationsResult = properties.LambdaConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketLambdaConfigurationPropertyFromCloudFormation)(properties.LambdaConfigurations) : undefined;
const queueConfigurationsResult = properties.QueueConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketQueueConfigurationPropertyFromCloudFormation)(properties.QueueConfigurations) : undefined;
const topicConfigurationsResult = properties.TopicConfigurations != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTopicConfigurationPropertyFromCloudFormation)(properties.TopicConfigurations) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
lambdaConfigurations: lambdaConfigurationsResult?.value,
queueConfigurations: queueConfigurationsResult?.value,
topicConfigurations: topicConfigurationsResult?.value,
});
ret.appendExtraProperties('LambdaConfigurations', lambdaConfigurationsResult?.extraProperties);
ret.appendExtraProperties('QueueConfigurations', queueConfigurationsResult?.extraProperties);
ret.appendExtraProperties('TopicConfigurations', topicConfigurationsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'LambdaConfigurations', 'QueueConfigurations', 'TopicConfigurations'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html
*/
export interface NotificationFilterProperty {
/**
* `CfnBucket.NotificationFilterProperty.S3Key`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key
*/
readonly s3Key: CfnBucket.S3KeyFilterProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `NotificationFilterProperty`
*
* @param properties - the TypeScript properties of a `NotificationFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_NotificationFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('s3Key', cdk.requiredValidator)(properties.s3Key));
errors.collect(cdk.propertyValidator('s3Key', CfnBucket_S3KeyFilterPropertyValidator)(properties.s3Key));
return errors.wrap('supplied properties not correct for "NotificationFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationFilter` resource
*
* @param properties - the TypeScript properties of a `NotificationFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.NotificationFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketNotificationFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_NotificationFilterPropertyValidator(properties).assertSuccess();
return {
S3Key: cfnBucketS3KeyFilterPropertyToCloudFormation(properties.s3Key),
};
}
// @ts-ignore TS6133
function CfnBucketNotificationFilterPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.NotificationFilterProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const s3KeyResult = CfnBucketS3KeyFilterPropertyFromCloudFormation(properties.S3Key);
const ret = new cfn_parse.FromCloudFormationResult({
s3Key: s3KeyResult?.value,
});
ret.appendExtraProperties('S3Key', s3KeyResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'S3Key'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html
*/
export interface ObjectLockConfigurationProperty {
/**
* `CfnBucket.ObjectLockConfigurationProperty.ObjectLockEnabled`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-objectlockenabled
*/
readonly objectLockEnabled?: string;
/**
* `CfnBucket.ObjectLockConfigurationProperty.Rule`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockconfiguration.html#cfn-s3-bucket-objectlockconfiguration-rule
*/
readonly rule?: CfnBucket.ObjectLockRuleProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ObjectLockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `ObjectLockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ObjectLockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('objectLockEnabled', cdk.validateString)(properties.objectLockEnabled));
errors.collect(cdk.propertyValidator('rule', CfnBucket_ObjectLockRulePropertyValidator)(properties.rule));
return errors.wrap('supplied properties not correct for "ObjectLockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockConfiguration` resource
*
* @param properties - the TypeScript properties of a `ObjectLockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketObjectLockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ObjectLockConfigurationPropertyValidator(properties).assertSuccess();
return {
ObjectLockEnabled: cdk.stringToCloudFormation(properties.objectLockEnabled),
Rule: cfnBucketObjectLockRulePropertyToCloudFormation(properties.rule),
};
}
// @ts-ignore TS6133
function CfnBucketObjectLockConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ObjectLockConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const objectLockEnabledResult = properties.ObjectLockEnabled != null ? cfn_parse.FromCloudFormation.getString(properties.ObjectLockEnabled) : undefined;
const ruleResult = properties.Rule != null ? CfnBucketObjectLockRulePropertyFromCloudFormation(properties.Rule) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
objectLockEnabled: objectLockEnabledResult?.value,
rule: ruleResult?.value,
});
ret.appendExtraProperties('ObjectLockEnabled', objectLockEnabledResult?.extraProperties);
ret.appendExtraProperties('Rule', ruleResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ObjectLockEnabled', 'Rule'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html
*/
export interface ObjectLockRuleProperty {
/**
* `CfnBucket.ObjectLockRuleProperty.DefaultRetention`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html#cfn-s3-bucket-objectlockrule-defaultretention
*/
readonly defaultRetention?: CfnBucket.DefaultRetentionProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ObjectLockRuleProperty`
*
* @param properties - the TypeScript properties of a `ObjectLockRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ObjectLockRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('defaultRetention', CfnBucket_DefaultRetentionPropertyValidator)(properties.defaultRetention));
return errors.wrap('supplied properties not correct for "ObjectLockRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockRule` resource
*
* @param properties - the TypeScript properties of a `ObjectLockRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ObjectLockRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketObjectLockRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ObjectLockRulePropertyValidator(properties).assertSuccess();
return {
DefaultRetention: cfnBucketDefaultRetentionPropertyToCloudFormation(properties.defaultRetention),
};
}
// @ts-ignore TS6133
function CfnBucketObjectLockRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ObjectLockRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const defaultRetentionResult = properties.DefaultRetention != null ? CfnBucketDefaultRetentionPropertyFromCloudFormation(properties.DefaultRetention) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
defaultRetention: defaultRetentionResult?.value,
});
ret.appendExtraProperties('DefaultRetention', defaultRetentionResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'DefaultRetention'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketOwnershipControlsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.OwnershipControlsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const rulesResult = cfn_parse.FromCloudFormation.getArray(CfnBucketOwnershipControlsRulePropertyFromCloudFormation)(properties.Rules);
const ret = new cfn_parse.FromCloudFormationResult({
rules: rulesResult?.value,
});
ret.appendExtraProperties('Rules', rulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Rules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketOwnershipControlsRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.OwnershipControlsRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const objectOwnershipResult = properties.ObjectOwnership != null ? cfn_parse.FromCloudFormation.getString(properties.ObjectOwnership) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
objectOwnership: objectOwnershipResult?.value,
});
ret.appendExtraProperties('ObjectOwnership', objectOwnershipResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ObjectOwnership'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html
*/
export interface PublicAccessBlockConfigurationProperty {
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.BlockPublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicacls
*/
readonly blockPublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.BlockPublicPolicy`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-blockpublicpolicy
*/
readonly blockPublicPolicy?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.IgnorePublicAcls`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-ignorepublicacls
*/
readonly ignorePublicAcls?: boolean | cdk.IResolvable;
/**
* `CfnBucket.PublicAccessBlockConfigurationProperty.RestrictPublicBuckets`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-publicaccessblockconfiguration.html#cfn-s3-bucket-publicaccessblockconfiguration-restrictpublicbuckets
*/
readonly restrictPublicBuckets?: boolean | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `PublicAccessBlockConfigurationProperty`
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_PublicAccessBlockConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('blockPublicAcls', cdk.validateBoolean)(properties.blockPublicAcls));
errors.collect(cdk.propertyValidator('blockPublicPolicy', cdk.validateBoolean)(properties.blockPublicPolicy));
errors.collect(cdk.propertyValidator('ignorePublicAcls', cdk.validateBoolean)(properties.ignorePublicAcls));
errors.collect(cdk.propertyValidator('restrictPublicBuckets', cdk.validateBoolean)(properties.restrictPublicBuckets));
return errors.wrap('supplied properties not correct for "PublicAccessBlockConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.PublicAccessBlockConfiguration` resource
*
* @param properties - the TypeScript properties of a `PublicAccessBlockConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.PublicAccessBlockConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketPublicAccessBlockConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_PublicAccessBlockConfigurationPropertyValidator(properties).assertSuccess();
return {
BlockPublicAcls: cdk.booleanToCloudFormation(properties.blockPublicAcls),
BlockPublicPolicy: cdk.booleanToCloudFormation(properties.blockPublicPolicy),
IgnorePublicAcls: cdk.booleanToCloudFormation(properties.ignorePublicAcls),
RestrictPublicBuckets: cdk.booleanToCloudFormation(properties.restrictPublicBuckets),
};
}
// @ts-ignore TS6133
function CfnBucketPublicAccessBlockConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.PublicAccessBlockConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const blockPublicAclsResult = properties.BlockPublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicAcls) : undefined;
const blockPublicPolicyResult = properties.BlockPublicPolicy != null ? cfn_parse.FromCloudFormation.getBoolean(properties.BlockPublicPolicy) : undefined;
const ignorePublicAclsResult = properties.IgnorePublicAcls != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IgnorePublicAcls) : undefined;
const restrictPublicBucketsResult = properties.RestrictPublicBuckets != null ? cfn_parse.FromCloudFormation.getBoolean(properties.RestrictPublicBuckets) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
blockPublicAcls: blockPublicAclsResult?.value,
blockPublicPolicy: blockPublicPolicyResult?.value,
ignorePublicAcls: ignorePublicAclsResult?.value,
restrictPublicBuckets: restrictPublicBucketsResult?.value,
});
ret.appendExtraProperties('BlockPublicAcls', blockPublicAclsResult?.extraProperties);
ret.appendExtraProperties('BlockPublicPolicy', blockPublicPolicyResult?.extraProperties);
ret.appendExtraProperties('IgnorePublicAcls', ignorePublicAclsResult?.extraProperties);
ret.appendExtraProperties('RestrictPublicBuckets', restrictPublicBucketsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', 'RestrictPublicBuckets'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html
*/
export interface QueueConfigurationProperty {
/**
* `CfnBucket.QueueConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-event
*/
readonly event: string;
/**
* `CfnBucket.QueueConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.QueueConfigurationProperty.Queue`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-queueconfig.html#cfn-s3-bucket-notificationconfig-queueconfig-queue
*/
readonly queue: string;
}
}
/**
* Determine whether the given properties match those of a `QueueConfigurationProperty`
*
* @param properties - the TypeScript properties of a `QueueConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_QueueConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('queue', cdk.requiredValidator)(properties.queue));
errors.collect(cdk.propertyValidator('queue', cdk.validateString)(properties.queue));
return errors.wrap('supplied properties not correct for "QueueConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.QueueConfiguration` resource
*
* @param properties - the TypeScript properties of a `QueueConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.QueueConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketQueueConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_QueueConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Queue: cdk.stringToCloudFormation(properties.queue),
};
}
// @ts-ignore TS6133
function CfnBucketQueueConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.QueueConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const eventResult = cfn_parse.FromCloudFormation.getString(properties.Event);
const filterResult = properties.Filter != null ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined;
const queueResult = cfn_parse.FromCloudFormation.getString(properties.Queue);
const ret = new cfn_parse.FromCloudFormationResult({
event: eventResult?.value,
filter: filterResult?.value,
queue: queueResult?.value,
});
ret.appendExtraProperties('Event', eventResult?.extraProperties);
ret.appendExtraProperties('Filter', filterResult?.extraProperties);
ret.appendExtraProperties('Queue', queueResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', 'Queue'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html
*/
export interface RedirectAllRequestsToProperty {
/**
* `CfnBucket.RedirectAllRequestsToProperty.HostName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-hostname
*/
readonly hostName: string;
/**
* `CfnBucket.RedirectAllRequestsToProperty.Protocol`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-redirectallrequeststo.html#cfn-s3-websiteconfiguration-redirectallrequeststo-protocol
*/
readonly protocol?: string;
}
}
/**
* Determine whether the given properties match those of a `RedirectAllRequestsToProperty`
*
* @param properties - the TypeScript properties of a `RedirectAllRequestsToProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RedirectAllRequestsToPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('hostName', cdk.requiredValidator)(properties.hostName));
errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
return errors.wrap('supplied properties not correct for "RedirectAllRequestsToProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectAllRequestsTo` resource
*
* @param properties - the TypeScript properties of a `RedirectAllRequestsToProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectAllRequestsTo` resource.
*/
// @ts-ignore TS6133
function cfnBucketRedirectAllRequestsToPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RedirectAllRequestsToPropertyValidator(properties).assertSuccess();
return {
HostName: cdk.stringToCloudFormation(properties.hostName),
Protocol: cdk.stringToCloudFormation(properties.protocol),
};
}
// @ts-ignore TS6133
function CfnBucketRedirectAllRequestsToPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.RedirectAllRequestsToProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const hostNameResult = cfn_parse.FromCloudFormation.getString(properties.HostName);
const protocolResult = properties.Protocol != null ? cfn_parse.FromCloudFormation.getString(properties.Protocol) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
hostName: hostNameResult?.value,
protocol: protocolResult?.value,
});
ret.appendExtraProperties('HostName', hostNameResult?.extraProperties);
ret.appendExtraProperties('Protocol', protocolResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'HostName', 'Protocol'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html
*/
export interface RedirectRuleProperty {
/**
* `CfnBucket.RedirectRuleProperty.HostName`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-hostname
*/
readonly hostName?: string;
/**
* `CfnBucket.RedirectRuleProperty.HttpRedirectCode`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-httpredirectcode
*/
readonly httpRedirectCode?: string;
/**
* `CfnBucket.RedirectRuleProperty.Protocol`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-protocol
*/
readonly protocol?: string;
/**
* `CfnBucket.RedirectRuleProperty.ReplaceKeyPrefixWith`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeyprefixwith
*/
readonly replaceKeyPrefixWith?: string;
/**
* `CfnBucket.RedirectRuleProperty.ReplaceKeyWith`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-redirectrule.html#cfn-s3-websiteconfiguration-redirectrule-replacekeywith
*/
readonly replaceKeyWith?: string;
}
}
/**
* Determine whether the given properties match those of a `RedirectRuleProperty`
*
* @param properties - the TypeScript properties of a `RedirectRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RedirectRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('hostName', cdk.validateString)(properties.hostName));
errors.collect(cdk.propertyValidator('httpRedirectCode', cdk.validateString)(properties.httpRedirectCode));
errors.collect(cdk.propertyValidator('protocol', cdk.validateString)(properties.protocol));
errors.collect(cdk.propertyValidator('replaceKeyPrefixWith', cdk.validateString)(properties.replaceKeyPrefixWith));
errors.collect(cdk.propertyValidator('replaceKeyWith', cdk.validateString)(properties.replaceKeyWith));
return errors.wrap('supplied properties not correct for "RedirectRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectRule` resource
*
* @param properties - the TypeScript properties of a `RedirectRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RedirectRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRedirectRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RedirectRulePropertyValidator(properties).assertSuccess();
return {
HostName: cdk.stringToCloudFormation(properties.hostName),
HttpRedirectCode: cdk.stringToCloudFormation(properties.httpRedirectCode),
Protocol: cdk.stringToCloudFormation(properties.protocol),
ReplaceKeyPrefixWith: cdk.stringToCloudFormation(properties.replaceKeyPrefixWith),
ReplaceKeyWith: cdk.stringToCloudFormation(properties.replaceKeyWith),
};
}
// @ts-ignore TS6133
function CfnBucketRedirectRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.RedirectRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const hostNameResult = properties.HostName != null ? cfn_parse.FromCloudFormation.getString(properties.HostName) : undefined;
const httpRedirectCodeResult = properties.HttpRedirectCode != null ? cfn_parse.FromCloudFormation.getString(properties.HttpRedirectCode) : undefined;
const protocolResult = properties.Protocol != null ? cfn_parse.FromCloudFormation.getString(properties.Protocol) : undefined;
const replaceKeyPrefixWithResult = properties.ReplaceKeyPrefixWith != null ? cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyPrefixWith) : undefined;
const replaceKeyWithResult = properties.ReplaceKeyWith != null ? cfn_parse.FromCloudFormation.getString(properties.ReplaceKeyWith) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
hostName: hostNameResult?.value,
httpRedirectCode: httpRedirectCodeResult?.value,
protocol: protocolResult?.value,
replaceKeyPrefixWith: replaceKeyPrefixWithResult?.value,
replaceKeyWith: replaceKeyWithResult?.value,
});
ret.appendExtraProperties('HostName', hostNameResult?.extraProperties);
ret.appendExtraProperties('HttpRedirectCode', httpRedirectCodeResult?.extraProperties);
ret.appendExtraProperties('Protocol', protocolResult?.extraProperties);
ret.appendExtraProperties('ReplaceKeyPrefixWith', replaceKeyPrefixWithResult?.extraProperties);
ret.appendExtraProperties('ReplaceKeyWith', replaceKeyWithResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'HostName', 'HttpRedirectCode', 'Protocol', 'ReplaceKeyPrefixWith', 'ReplaceKeyWith'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html
*/
export interface ReplicationConfigurationProperty {
/**
* `CfnBucket.ReplicationConfigurationProperty.Role`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-role
*/
readonly role: string;
/**
* `CfnBucket.ReplicationConfigurationProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-replicationconfiguration.html#cfn-s3-bucket-replicationconfiguration-rules
*/
readonly rules: Array<CfnBucket.ReplicationRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ReplicationConfigurationProperty`
*
* @param properties - the TypeScript properties of a `ReplicationConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ReplicationConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('role', cdk.requiredValidator)(properties.role));
errors.collect(cdk.propertyValidator('role', cdk.validateString)(properties.role));
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_ReplicationRulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "ReplicationConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationConfiguration` resource
*
* @param properties - the TypeScript properties of a `ReplicationConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ReplicationConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketReplicationConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ReplicationConfigurationPropertyValidator(properties).assertSuccess();
return {
Role: cdk.stringToCloudFormation(properties.role),
Rules: cdk.listMapper(cfnBucketReplicationRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const roleResult = cfn_parse.FromCloudFormation.getString(properties.Role);
const rulesResult = cfn_parse.FromCloudFormation.getArray(CfnBucketReplicationRulePropertyFromCloudFormation)(properties.Rules);
const ret = new cfn_parse.FromCloudFormationResult({
role: roleResult?.value,
rules: rulesResult?.value,
});
ret.appendExtraProperties('Role', roleResult?.extraProperties);
ret.appendExtraProperties('Rules', rulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Role', 'Rules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationDestinationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationDestinationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const accessControlTranslationResult = properties.AccessControlTranslation != null ? CfnBucketAccessControlTranslationPropertyFromCloudFormation(properties.AccessControlTranslation) : undefined;
const accountResult = properties.Account != null ? cfn_parse.FromCloudFormation.getString(properties.Account) : undefined;
const bucketResult = cfn_parse.FromCloudFormation.getString(properties.Bucket);
const encryptionConfigurationResult = properties.EncryptionConfiguration != null ? CfnBucketEncryptionConfigurationPropertyFromCloudFormation(properties.EncryptionConfiguration) : undefined;
const metricsResult = properties.Metrics != null ? CfnBucketMetricsPropertyFromCloudFormation(properties.Metrics) : undefined;
const replicationTimeResult = properties.ReplicationTime != null ? CfnBucketReplicationTimePropertyFromCloudFormation(properties.ReplicationTime) : undefined;
const storageClassResult = properties.StorageClass != null ? cfn_parse.FromCloudFormation.getString(properties.StorageClass) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
accessControlTranslation: accessControlTranslationResult?.value,
account: accountResult?.value,
bucket: bucketResult?.value,
encryptionConfiguration: encryptionConfigurationResult?.value,
metrics: metricsResult?.value,
replicationTime: replicationTimeResult?.value,
storageClass: storageClassResult?.value,
});
ret.appendExtraProperties('AccessControlTranslation', accessControlTranslationResult?.extraProperties);
ret.appendExtraProperties('Account', accountResult?.extraProperties);
ret.appendExtraProperties('Bucket', bucketResult?.extraProperties);
ret.appendExtraProperties('EncryptionConfiguration', encryptionConfigurationResult?.extraProperties);
ret.appendExtraProperties('Metrics', metricsResult?.extraProperties);
ret.appendExtraProperties('ReplicationTime', replicationTimeResult?.extraProperties);
ret.appendExtraProperties('StorageClass', storageClassResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AccessControlTranslation', 'Account', 'Bucket', 'EncryptionConfiguration', 'Metrics', 'ReplicationTime', 'StorageClass'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const deleteMarkerReplicationResult = properties.DeleteMarkerReplication != null ? CfnBucketDeleteMarkerReplicationPropertyFromCloudFormation(properties.DeleteMarkerReplication) : undefined;
const destinationResult = CfnBucketReplicationDestinationPropertyFromCloudFormation(properties.Destination);
const filterResult = properties.Filter != null ? CfnBucketReplicationRuleFilterPropertyFromCloudFormation(properties.Filter) : undefined;
const idResult = properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined;
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const priorityResult = properties.Priority != null ? cfn_parse.FromCloudFormation.getNumber(properties.Priority) : undefined;
const sourceSelectionCriteriaResult = properties.SourceSelectionCriteria != null ? CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties.SourceSelectionCriteria) : undefined;
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const ret = new cfn_parse.FromCloudFormationResult({
deleteMarkerReplication: deleteMarkerReplicationResult?.value,
destination: destinationResult?.value,
filter: filterResult?.value,
id: idResult?.value,
prefix: prefixResult?.value,
priority: priorityResult?.value,
sourceSelectionCriteria: sourceSelectionCriteriaResult?.value,
status: statusResult?.value,
});
ret.appendExtraProperties('DeleteMarkerReplication', deleteMarkerReplicationResult?.extraProperties);
ret.appendExtraProperties('Destination', destinationResult?.extraProperties);
ret.appendExtraProperties('Filter', filterResult?.extraProperties);
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('Priority', priorityResult?.extraProperties);
ret.appendExtraProperties('SourceSelectionCriteria', sourceSelectionCriteriaResult?.extraProperties);
ret.appendExtraProperties('Status', statusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'DeleteMarkerReplication', 'Destination', 'Filter', 'Id', 'Prefix', 'Priority', 'SourceSelectionCriteria', 'Status'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRuleAndOperatorPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationRuleAndOperatorProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const tagFiltersResult = properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
prefix: prefixResult?.value,
tagFilters: tagFiltersResult?.value,
});
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('TagFilters', tagFiltersResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Prefix', 'TagFilters'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationRuleFilterPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationRuleFilterProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const andResult = properties.And != null ? CfnBucketReplicationRuleAndOperatorPropertyFromCloudFormation(properties.And) : undefined;
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const tagFilterResult = properties.TagFilter != null ? CfnBucketTagFilterPropertyFromCloudFormation(properties.TagFilter) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
and: andResult?.value,
prefix: prefixResult?.value,
tagFilter: tagFilterResult?.value,
});
ret.appendExtraProperties('And', andResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('TagFilter', tagFilterResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'And', 'Prefix', 'TagFilter'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationTimePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationTimeProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const timeResult = CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties.Time);
const ret = new cfn_parse.FromCloudFormationResult({
status: statusResult?.value,
time: timeResult?.value,
});
ret.appendExtraProperties('Status', statusResult?.extraProperties);
ret.appendExtraProperties('Time', timeResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Status', 'Time'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketReplicationTimeValuePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ReplicationTimeValueProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const minutesResult = cfn_parse.FromCloudFormation.getNumber(properties.Minutes);
const ret = new cfn_parse.FromCloudFormationResult({
minutes: minutesResult?.value,
});
ret.appendExtraProperties('Minutes', minutesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Minutes'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html
*/
export interface RoutingRuleProperty {
/**
* `CfnBucket.RoutingRuleProperty.RedirectRule`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-redirectrule
*/
readonly redirectRule: CfnBucket.RedirectRuleProperty | cdk.IResolvable;
/**
* `CfnBucket.RoutingRuleProperty.RoutingRuleCondition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition
*/
readonly routingRuleCondition?: CfnBucket.RoutingRuleConditionProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `RoutingRuleProperty`
*
* @param properties - the TypeScript properties of a `RoutingRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RoutingRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('redirectRule', cdk.requiredValidator)(properties.redirectRule));
errors.collect(cdk.propertyValidator('redirectRule', CfnBucket_RedirectRulePropertyValidator)(properties.redirectRule));
errors.collect(cdk.propertyValidator('routingRuleCondition', CfnBucket_RoutingRuleConditionPropertyValidator)(properties.routingRuleCondition));
return errors.wrap('supplied properties not correct for "RoutingRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRule` resource
*
* @param properties - the TypeScript properties of a `RoutingRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRoutingRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RoutingRulePropertyValidator(properties).assertSuccess();
return {
RedirectRule: cfnBucketRedirectRulePropertyToCloudFormation(properties.redirectRule),
RoutingRuleCondition: cfnBucketRoutingRuleConditionPropertyToCloudFormation(properties.routingRuleCondition),
};
}
// @ts-ignore TS6133
function CfnBucketRoutingRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.RoutingRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const redirectRuleResult = CfnBucketRedirectRulePropertyFromCloudFormation(properties.RedirectRule);
const routingRuleConditionResult = properties.RoutingRuleCondition != null ? CfnBucketRoutingRuleConditionPropertyFromCloudFormation(properties.RoutingRuleCondition) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
redirectRule: redirectRuleResult?.value,
routingRuleCondition: routingRuleConditionResult?.value,
});
ret.appendExtraProperties('RedirectRule', redirectRuleResult?.extraProperties);
ret.appendExtraProperties('RoutingRuleCondition', routingRuleConditionResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'RedirectRule', 'RoutingRuleCondition'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html
*/
export interface RoutingRuleConditionProperty {
/**
* `CfnBucket.RoutingRuleConditionProperty.HttpErrorCodeReturnedEquals`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-httperrorcodereturnedequals
*/
readonly httpErrorCodeReturnedEquals?: string;
/**
* `CfnBucket.RoutingRuleConditionProperty.KeyPrefixEquals`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules-routingrulecondition.html#cfn-s3-websiteconfiguration-routingrules-routingrulecondition-keyprefixequals
*/
readonly keyPrefixEquals?: string;
}
}
/**
* Determine whether the given properties match those of a `RoutingRuleConditionProperty`
*
* @param properties - the TypeScript properties of a `RoutingRuleConditionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RoutingRuleConditionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('httpErrorCodeReturnedEquals', cdk.validateString)(properties.httpErrorCodeReturnedEquals));
errors.collect(cdk.propertyValidator('keyPrefixEquals', cdk.validateString)(properties.keyPrefixEquals));
return errors.wrap('supplied properties not correct for "RoutingRuleConditionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRuleCondition` resource
*
* @param properties - the TypeScript properties of a `RoutingRuleConditionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.RoutingRuleCondition` resource.
*/
// @ts-ignore TS6133
function cfnBucketRoutingRuleConditionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RoutingRuleConditionPropertyValidator(properties).assertSuccess();
return {
HttpErrorCodeReturnedEquals: cdk.stringToCloudFormation(properties.httpErrorCodeReturnedEquals),
KeyPrefixEquals: cdk.stringToCloudFormation(properties.keyPrefixEquals),
};
}
// @ts-ignore TS6133
function CfnBucketRoutingRuleConditionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.RoutingRuleConditionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const httpErrorCodeReturnedEqualsResult = properties.HttpErrorCodeReturnedEquals != null ? cfn_parse.FromCloudFormation.getString(properties.HttpErrorCodeReturnedEquals) : undefined;
const keyPrefixEqualsResult = properties.KeyPrefixEquals != null ? cfn_parse.FromCloudFormation.getString(properties.KeyPrefixEquals) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
httpErrorCodeReturnedEquals: httpErrorCodeReturnedEqualsResult?.value,
keyPrefixEquals: keyPrefixEqualsResult?.value,
});
ret.appendExtraProperties('HttpErrorCodeReturnedEquals', httpErrorCodeReturnedEqualsResult?.extraProperties);
ret.appendExtraProperties('KeyPrefixEquals', keyPrefixEqualsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'HttpErrorCodeReturnedEquals', 'KeyPrefixEquals'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html
*/
export interface RuleProperty {
/**
* `CfnBucket.RuleProperty.AbortIncompleteMultipartUpload`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-abortincompletemultipartupload
*/
readonly abortIncompleteMultipartUpload?: CfnBucket.AbortIncompleteMultipartUploadProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.ExpirationDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationdate
*/
readonly expirationDate?: Date | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.ExpirationInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-expirationindays
*/
readonly expirationInDays?: number;
/**
* `CfnBucket.RuleProperty.Id`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-id
*/
readonly id?: string;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionExpirationInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversionexpirationindays
*/
readonly noncurrentVersionExpirationInDays?: number;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionTransition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransition
*/
readonly noncurrentVersionTransition?: CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.NoncurrentVersionTransitions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-noncurrentversiontransitions
*/
readonly noncurrentVersionTransitions?: Array<CfnBucket.NoncurrentVersionTransitionProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Prefix`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-prefix
*/
readonly prefix?: string;
/**
* `CfnBucket.RuleProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-status
*/
readonly status: string;
/**
* `CfnBucket.RuleProperty.TagFilters`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-tagfilters
*/
readonly tagFilters?: Array<CfnBucket.TagFilterProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Transition`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transition
*/
readonly transition?: CfnBucket.TransitionProperty | cdk.IResolvable;
/**
* `CfnBucket.RuleProperty.Transitions`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-lifecycleconfig-rule-transitions
*/
readonly transitions?: Array<CfnBucket.TransitionProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `RuleProperty`
*
* @param properties - the TypeScript properties of a `RuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_RulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('abortIncompleteMultipartUpload', CfnBucket_AbortIncompleteMultipartUploadPropertyValidator)(properties.abortIncompleteMultipartUpload));
errors.collect(cdk.propertyValidator('expirationDate', cdk.validateDate)(properties.expirationDate));
errors.collect(cdk.propertyValidator('expirationInDays', cdk.validateNumber)(properties.expirationInDays));
errors.collect(cdk.propertyValidator('id', cdk.validateString)(properties.id));
errors.collect(cdk.propertyValidator('noncurrentVersionExpirationInDays', cdk.validateNumber)(properties.noncurrentVersionExpirationInDays));
errors.collect(cdk.propertyValidator('noncurrentVersionTransition', CfnBucket_NoncurrentVersionTransitionPropertyValidator)(properties.noncurrentVersionTransition));
errors.collect(cdk.propertyValidator('noncurrentVersionTransitions', cdk.listValidator(CfnBucket_NoncurrentVersionTransitionPropertyValidator))(properties.noncurrentVersionTransitions));
errors.collect(cdk.propertyValidator('prefix', cdk.validateString)(properties.prefix));
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
errors.collect(cdk.propertyValidator('tagFilters', cdk.listValidator(CfnBucket_TagFilterPropertyValidator))(properties.tagFilters));
errors.collect(cdk.propertyValidator('transition', CfnBucket_TransitionPropertyValidator)(properties.transition));
errors.collect(cdk.propertyValidator('transitions', cdk.listValidator(CfnBucket_TransitionPropertyValidator))(properties.transitions));
return errors.wrap('supplied properties not correct for "RuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Rule` resource
*
* @param properties - the TypeScript properties of a `RuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Rule` resource.
*/
// @ts-ignore TS6133
function cfnBucketRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_RulePropertyValidator(properties).assertSuccess();
return {
AbortIncompleteMultipartUpload: cfnBucketAbortIncompleteMultipartUploadPropertyToCloudFormation(properties.abortIncompleteMultipartUpload),
ExpirationDate: cdk.dateToCloudFormation(properties.expirationDate),
ExpirationInDays: cdk.numberToCloudFormation(properties.expirationInDays),
Id: cdk.stringToCloudFormation(properties.id),
NoncurrentVersionExpirationInDays: cdk.numberToCloudFormation(properties.noncurrentVersionExpirationInDays),
NoncurrentVersionTransition: cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation(properties.noncurrentVersionTransition),
NoncurrentVersionTransitions: cdk.listMapper(cfnBucketNoncurrentVersionTransitionPropertyToCloudFormation)(properties.noncurrentVersionTransitions),
Prefix: cdk.stringToCloudFormation(properties.prefix),
Status: cdk.stringToCloudFormation(properties.status),
TagFilters: cdk.listMapper(cfnBucketTagFilterPropertyToCloudFormation)(properties.tagFilters),
Transition: cfnBucketTransitionPropertyToCloudFormation(properties.transition),
Transitions: cdk.listMapper(cfnBucketTransitionPropertyToCloudFormation)(properties.transitions),
};
}
// @ts-ignore TS6133
function CfnBucketRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.RuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const abortIncompleteMultipartUploadResult = properties.AbortIncompleteMultipartUpload != null ? CfnBucketAbortIncompleteMultipartUploadPropertyFromCloudFormation(properties.AbortIncompleteMultipartUpload) : undefined;
const expirationDateResult = properties.ExpirationDate != null ? cfn_parse.FromCloudFormation.getDate(properties.ExpirationDate) : undefined;
const expirationInDaysResult = properties.ExpirationInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.ExpirationInDays) : undefined;
const idResult = properties.Id != null ? cfn_parse.FromCloudFormation.getString(properties.Id) : undefined;
const noncurrentVersionExpirationInDaysResult = properties.NoncurrentVersionExpirationInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.NoncurrentVersionExpirationInDays) : undefined;
const noncurrentVersionTransitionResult = properties.NoncurrentVersionTransition != null ? CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation(properties.NoncurrentVersionTransition) : undefined;
const noncurrentVersionTransitionsResult = properties.NoncurrentVersionTransitions != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketNoncurrentVersionTransitionPropertyFromCloudFormation)(properties.NoncurrentVersionTransitions) : undefined;
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const tagFiltersResult = properties.TagFilters != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTagFilterPropertyFromCloudFormation)(properties.TagFilters) : undefined;
const transitionResult = properties.Transition != null ? CfnBucketTransitionPropertyFromCloudFormation(properties.Transition) : undefined;
const transitionsResult = properties.Transitions != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketTransitionPropertyFromCloudFormation)(properties.Transitions) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
abortIncompleteMultipartUpload: abortIncompleteMultipartUploadResult?.value,
expirationDate: expirationDateResult?.value,
expirationInDays: expirationInDaysResult?.value,
id: idResult?.value,
noncurrentVersionExpirationInDays: noncurrentVersionExpirationInDaysResult?.value,
noncurrentVersionTransition: noncurrentVersionTransitionResult?.value,
noncurrentVersionTransitions: noncurrentVersionTransitionsResult?.value,
prefix: prefixResult?.value,
status: statusResult?.value,
tagFilters: tagFiltersResult?.value,
transition: transitionResult?.value,
transitions: transitionsResult?.value,
});
ret.appendExtraProperties('AbortIncompleteMultipartUpload', abortIncompleteMultipartUploadResult?.extraProperties);
ret.appendExtraProperties('ExpirationDate', expirationDateResult?.extraProperties);
ret.appendExtraProperties('ExpirationInDays', expirationInDaysResult?.extraProperties);
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('NoncurrentVersionExpirationInDays', noncurrentVersionExpirationInDaysResult?.extraProperties);
ret.appendExtraProperties('NoncurrentVersionTransition', noncurrentVersionTransitionResult?.extraProperties);
ret.appendExtraProperties('NoncurrentVersionTransitions', noncurrentVersionTransitionsResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
ret.appendExtraProperties('Status', statusResult?.extraProperties);
ret.appendExtraProperties('TagFilters', tagFiltersResult?.extraProperties);
ret.appendExtraProperties('Transition', transitionResult?.extraProperties);
ret.appendExtraProperties('Transitions', transitionsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AbortIncompleteMultipartUpload', 'ExpirationDate', 'ExpirationInDays', 'Id', 'NoncurrentVersionExpirationInDays', 'NoncurrentVersionTransition', 'NoncurrentVersionTransitions', 'Prefix', 'Status', 'TagFilters', 'Transition', 'Transitions'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html
*/
export interface S3KeyFilterProperty {
/**
* `CfnBucket.S3KeyFilterProperty.Rules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfiguration-config-filter-s3key.html#cfn-s3-bucket-notificationconfiguraiton-config-filter-s3key-rules
*/
readonly rules: Array<CfnBucket.FilterRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `S3KeyFilterProperty`
*
* @param properties - the TypeScript properties of a `S3KeyFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_S3KeyFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('rules', cdk.requiredValidator)(properties.rules));
errors.collect(cdk.propertyValidator('rules', cdk.listValidator(CfnBucket_FilterRulePropertyValidator))(properties.rules));
return errors.wrap('supplied properties not correct for "S3KeyFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.S3KeyFilter` resource
*
* @param properties - the TypeScript properties of a `S3KeyFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.S3KeyFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketS3KeyFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_S3KeyFilterPropertyValidator(properties).assertSuccess();
return {
Rules: cdk.listMapper(cfnBucketFilterRulePropertyToCloudFormation)(properties.rules),
};
}
// @ts-ignore TS6133
function CfnBucketS3KeyFilterPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.S3KeyFilterProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const rulesResult = cfn_parse.FromCloudFormation.getArray(CfnBucketFilterRulePropertyFromCloudFormation)(properties.Rules);
const ret = new cfn_parse.FromCloudFormationResult({
rules: rulesResult?.value,
});
ret.appendExtraProperties('Rules', rulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Rules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html
*/
export interface ServerSideEncryptionByDefaultProperty {
/**
* `CfnBucket.ServerSideEncryptionByDefaultProperty.KMSMasterKeyID`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-kmsmasterkeyid
*/
readonly kmsMasterKeyId?: string;
/**
* `CfnBucket.ServerSideEncryptionByDefaultProperty.SSEAlgorithm`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionbydefault.html#cfn-s3-bucket-serversideencryptionbydefault-ssealgorithm
*/
readonly sseAlgorithm: string;
}
}
/**
* Determine whether the given properties match those of a `ServerSideEncryptionByDefaultProperty`
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionByDefaultProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ServerSideEncryptionByDefaultPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('kmsMasterKeyId', cdk.validateString)(properties.kmsMasterKeyId));
errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.requiredValidator)(properties.sseAlgorithm));
errors.collect(cdk.propertyValidator('sseAlgorithm', cdk.validateString)(properties.sseAlgorithm));
return errors.wrap('supplied properties not correct for "ServerSideEncryptionByDefaultProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionByDefault` resource
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionByDefaultProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionByDefault` resource.
*/
// @ts-ignore TS6133
function cfnBucketServerSideEncryptionByDefaultPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ServerSideEncryptionByDefaultPropertyValidator(properties).assertSuccess();
return {
KMSMasterKeyID: cdk.stringToCloudFormation(properties.kmsMasterKeyId),
SSEAlgorithm: cdk.stringToCloudFormation(properties.sseAlgorithm),
};
}
// @ts-ignore TS6133
function CfnBucketServerSideEncryptionByDefaultPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ServerSideEncryptionByDefaultProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const kmsMasterKeyIdResult = properties.KMSMasterKeyID != null ? cfn_parse.FromCloudFormation.getString(properties.KMSMasterKeyID) : undefined;
const sseAlgorithmResult = cfn_parse.FromCloudFormation.getString(properties.SSEAlgorithm);
const ret = new cfn_parse.FromCloudFormationResult({
kmsMasterKeyId: kmsMasterKeyIdResult?.value,
sseAlgorithm: sseAlgorithmResult?.value,
});
ret.appendExtraProperties('KMSMasterKeyID', kmsMasterKeyIdResult?.extraProperties);
ret.appendExtraProperties('SSEAlgorithm', sseAlgorithmResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'KMSMasterKeyID', 'SSEAlgorithm'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionrule.html
*/
export interface ServerSideEncryptionRuleProperty {
/**
* `CfnBucket.ServerSideEncryptionRuleProperty.ServerSideEncryptionByDefault`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-serversideencryptionrule.html#cfn-s3-bucket-serversideencryptionrule-serversideencryptionbydefault
*/
readonly serverSideEncryptionByDefault?: CfnBucket.ServerSideEncryptionByDefaultProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `ServerSideEncryptionRuleProperty`
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionRuleProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_ServerSideEncryptionRulePropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('serverSideEncryptionByDefault', CfnBucket_ServerSideEncryptionByDefaultPropertyValidator)(properties.serverSideEncryptionByDefault));
return errors.wrap('supplied properties not correct for "ServerSideEncryptionRuleProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionRule` resource
*
* @param properties - the TypeScript properties of a `ServerSideEncryptionRuleProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.ServerSideEncryptionRule` resource.
*/
// @ts-ignore TS6133
function cfnBucketServerSideEncryptionRulePropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_ServerSideEncryptionRulePropertyValidator(properties).assertSuccess();
return {
ServerSideEncryptionByDefault: cfnBucketServerSideEncryptionByDefaultPropertyToCloudFormation(properties.serverSideEncryptionByDefault),
};
}
// @ts-ignore TS6133
function CfnBucketServerSideEncryptionRulePropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.ServerSideEncryptionRuleProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const serverSideEncryptionByDefaultResult = properties.ServerSideEncryptionByDefault != null ? CfnBucketServerSideEncryptionByDefaultPropertyFromCloudFormation(properties.ServerSideEncryptionByDefault) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
serverSideEncryptionByDefault: serverSideEncryptionByDefaultResult?.value,
});
ret.appendExtraProperties('ServerSideEncryptionByDefault', serverSideEncryptionByDefaultResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ServerSideEncryptionByDefault'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketSourceSelectionCriteriaPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.SourceSelectionCriteriaProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const sseKmsEncryptedObjectsResult = properties.SseKmsEncryptedObjects != null ? CfnBucketSseKmsEncryptedObjectsPropertyFromCloudFormation(properties.SseKmsEncryptedObjects) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
sseKmsEncryptedObjects: sseKmsEncryptedObjectsResult?.value,
});
ret.appendExtraProperties('SseKmsEncryptedObjects', sseKmsEncryptedObjectsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'SseKmsEncryptedObjects'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html
*/
export interface SseKmsEncryptedObjectsProperty {
/**
* `CfnBucket.SseKmsEncryptedObjectsProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ssekmsencryptedobjects.html#cfn-s3-bucket-ssekmsencryptedobjects-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `SseKmsEncryptedObjectsProperty`
*
* @param properties - the TypeScript properties of a `SseKmsEncryptedObjectsProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_SseKmsEncryptedObjectsPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "SseKmsEncryptedObjectsProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.SseKmsEncryptedObjects` resource
*
* @param properties - the TypeScript properties of a `SseKmsEncryptedObjectsProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.SseKmsEncryptedObjects` resource.
*/
// @ts-ignore TS6133
function cfnBucketSseKmsEncryptedObjectsPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_SseKmsEncryptedObjectsPropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
};
}
// @ts-ignore TS6133
function CfnBucketSseKmsEncryptedObjectsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.SseKmsEncryptedObjectsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const ret = new cfn_parse.FromCloudFormationResult({
status: statusResult?.value,
});
ret.appendExtraProperties('Status', statusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Status'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-storageclassanalysis.html
*/
export interface StorageClassAnalysisProperty {
/**
* `CfnBucket.StorageClassAnalysisProperty.DataExport`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-storageclassanalysis.html#cfn-s3-bucket-storageclassanalysis-dataexport
*/
readonly dataExport?: CfnBucket.DataExportProperty | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `StorageClassAnalysisProperty`
*
* @param properties - the TypeScript properties of a `StorageClassAnalysisProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_StorageClassAnalysisPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('dataExport', CfnBucket_DataExportPropertyValidator)(properties.dataExport));
return errors.wrap('supplied properties not correct for "StorageClassAnalysisProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.StorageClassAnalysis` resource
*
* @param properties - the TypeScript properties of a `StorageClassAnalysisProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.StorageClassAnalysis` resource.
*/
// @ts-ignore TS6133
function cfnBucketStorageClassAnalysisPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_StorageClassAnalysisPropertyValidator(properties).assertSuccess();
return {
DataExport: cfnBucketDataExportPropertyToCloudFormation(properties.dataExport),
};
}
// @ts-ignore TS6133
function CfnBucketStorageClassAnalysisPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.StorageClassAnalysisProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const dataExportResult = properties.DataExport != null ? CfnBucketDataExportPropertyFromCloudFormation(properties.DataExport) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
dataExport: dataExportResult?.value,
});
ret.appendExtraProperties('DataExport', dataExportResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'DataExport'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html
*/
export interface TagFilterProperty {
/**
* `CfnBucket.TagFilterProperty.Key`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-key
*/
readonly key: string;
/**
* `CfnBucket.TagFilterProperty.Value`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-tagfilter.html#cfn-s3-bucket-tagfilter-value
*/
readonly value: string;
}
}
/**
* Determine whether the given properties match those of a `TagFilterProperty`
*
* @param properties - the TypeScript properties of a `TagFilterProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TagFilterPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('key', cdk.requiredValidator)(properties.key));
errors.collect(cdk.propertyValidator('key', cdk.validateString)(properties.key));
errors.collect(cdk.propertyValidator('value', cdk.requiredValidator)(properties.value));
errors.collect(cdk.propertyValidator('value', cdk.validateString)(properties.value));
return errors.wrap('supplied properties not correct for "TagFilterProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.TagFilter` resource
*
* @param properties - the TypeScript properties of a `TagFilterProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.TagFilter` resource.
*/
// @ts-ignore TS6133
function cfnBucketTagFilterPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TagFilterPropertyValidator(properties).assertSuccess();
return {
Key: cdk.stringToCloudFormation(properties.key),
Value: cdk.stringToCloudFormation(properties.value),
};
}
// @ts-ignore TS6133
function CfnBucketTagFilterPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.TagFilterProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const keyResult = cfn_parse.FromCloudFormation.getString(properties.Key);
const valueResult = cfn_parse.FromCloudFormation.getString(properties.Value);
const ret = new cfn_parse.FromCloudFormationResult({
key: keyResult?.value,
value: valueResult?.value,
});
ret.appendExtraProperties('Key', keyResult?.extraProperties);
ret.appendExtraProperties('Value', valueResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Key', 'Value'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnBucketTieringPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.TieringProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const accessTierResult = cfn_parse.FromCloudFormation.getString(properties.AccessTier);
const daysResult = cfn_parse.FromCloudFormation.getNumber(properties.Days);
const ret = new cfn_parse.FromCloudFormationResult({
accessTier: accessTierResult?.value,
days: daysResult?.value,
});
ret.appendExtraProperties('AccessTier', accessTierResult?.extraProperties);
ret.appendExtraProperties('Days', daysResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AccessTier', 'Days'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html
*/
export interface TopicConfigurationProperty {
/**
* `CfnBucket.TopicConfigurationProperty.Event`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-event
*/
readonly event: string;
/**
* `CfnBucket.TopicConfigurationProperty.Filter`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-filter
*/
readonly filter?: CfnBucket.NotificationFilterProperty | cdk.IResolvable;
/**
* `CfnBucket.TopicConfigurationProperty.Topic`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-notificationconfig-topicconfig.html#cfn-s3-bucket-notificationconfig-topicconfig-topic
*/
readonly topic: string;
}
}
/**
* Determine whether the given properties match those of a `TopicConfigurationProperty`
*
* @param properties - the TypeScript properties of a `TopicConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TopicConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('event', cdk.requiredValidator)(properties.event));
errors.collect(cdk.propertyValidator('event', cdk.validateString)(properties.event));
errors.collect(cdk.propertyValidator('filter', CfnBucket_NotificationFilterPropertyValidator)(properties.filter));
errors.collect(cdk.propertyValidator('topic', cdk.requiredValidator)(properties.topic));
errors.collect(cdk.propertyValidator('topic', cdk.validateString)(properties.topic));
return errors.wrap('supplied properties not correct for "TopicConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.TopicConfiguration` resource
*
* @param properties - the TypeScript properties of a `TopicConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.TopicConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketTopicConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TopicConfigurationPropertyValidator(properties).assertSuccess();
return {
Event: cdk.stringToCloudFormation(properties.event),
Filter: cfnBucketNotificationFilterPropertyToCloudFormation(properties.filter),
Topic: cdk.stringToCloudFormation(properties.topic),
};
}
// @ts-ignore TS6133
function CfnBucketTopicConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.TopicConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const eventResult = cfn_parse.FromCloudFormation.getString(properties.Event);
const filterResult = properties.Filter != null ? CfnBucketNotificationFilterPropertyFromCloudFormation(properties.Filter) : undefined;
const topicResult = cfn_parse.FromCloudFormation.getString(properties.Topic);
const ret = new cfn_parse.FromCloudFormationResult({
event: eventResult?.value,
filter: filterResult?.value,
topic: topicResult?.value,
});
ret.appendExtraProperties('Event', eventResult?.extraProperties);
ret.appendExtraProperties('Filter', filterResult?.extraProperties);
ret.appendExtraProperties('Topic', topicResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Event', 'Filter', 'Topic'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html
*/
export interface TransitionProperty {
/**
* `CfnBucket.TransitionProperty.StorageClass`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-storageclass
*/
readonly storageClass: string;
/**
* `CfnBucket.TransitionProperty.TransitionDate`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitiondate
*/
readonly transitionDate?: Date | cdk.IResolvable;
/**
* `CfnBucket.TransitionProperty.TransitionInDays`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule-transition.html#cfn-s3-bucket-lifecycleconfig-rule-transition-transitionindays
*/
readonly transitionInDays?: number;
}
}
/**
* Determine whether the given properties match those of a `TransitionProperty`
*
* @param properties - the TypeScript properties of a `TransitionProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_TransitionPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('storageClass', cdk.requiredValidator)(properties.storageClass));
errors.collect(cdk.propertyValidator('storageClass', cdk.validateString)(properties.storageClass));
errors.collect(cdk.propertyValidator('transitionDate', cdk.validateDate)(properties.transitionDate));
errors.collect(cdk.propertyValidator('transitionInDays', cdk.validateNumber)(properties.transitionInDays));
return errors.wrap('supplied properties not correct for "TransitionProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.Transition` resource
*
* @param properties - the TypeScript properties of a `TransitionProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.Transition` resource.
*/
// @ts-ignore TS6133
function cfnBucketTransitionPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_TransitionPropertyValidator(properties).assertSuccess();
return {
StorageClass: cdk.stringToCloudFormation(properties.storageClass),
TransitionDate: cdk.dateToCloudFormation(properties.transitionDate),
TransitionInDays: cdk.numberToCloudFormation(properties.transitionInDays),
};
}
// @ts-ignore TS6133
function CfnBucketTransitionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.TransitionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const storageClassResult = cfn_parse.FromCloudFormation.getString(properties.StorageClass);
const transitionDateResult = properties.TransitionDate != null ? cfn_parse.FromCloudFormation.getDate(properties.TransitionDate) : undefined;
const transitionInDaysResult = properties.TransitionInDays != null ? cfn_parse.FromCloudFormation.getNumber(properties.TransitionInDays) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
storageClass: storageClassResult?.value,
transitionDate: transitionDateResult?.value,
transitionInDays: transitionInDaysResult?.value,
});
ret.appendExtraProperties('StorageClass', storageClassResult?.extraProperties);
ret.appendExtraProperties('TransitionDate', transitionDateResult?.extraProperties);
ret.appendExtraProperties('TransitionInDays', transitionInDaysResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'StorageClass', 'TransitionDate', 'TransitionInDays'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-versioningconfig.html
*/
export interface VersioningConfigurationProperty {
/**
* `CfnBucket.VersioningConfigurationProperty.Status`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-versioningconfig.html#cfn-s3-bucket-versioningconfig-status
*/
readonly status: string;
}
}
/**
* Determine whether the given properties match those of a `VersioningConfigurationProperty`
*
* @param properties - the TypeScript properties of a `VersioningConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_VersioningConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('status', cdk.requiredValidator)(properties.status));
errors.collect(cdk.propertyValidator('status', cdk.validateString)(properties.status));
return errors.wrap('supplied properties not correct for "VersioningConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.VersioningConfiguration` resource
*
* @param properties - the TypeScript properties of a `VersioningConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.VersioningConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketVersioningConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_VersioningConfigurationPropertyValidator(properties).assertSuccess();
return {
Status: cdk.stringToCloudFormation(properties.status),
};
}
// @ts-ignore TS6133
function CfnBucketVersioningConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.VersioningConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const statusResult = cfn_parse.FromCloudFormation.getString(properties.Status);
const ret = new cfn_parse.FromCloudFormationResult({
status: statusResult?.value,
});
ret.appendExtraProperties('Status', statusResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Status'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
export namespace CfnBucket {
/**
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html
*/
export interface WebsiteConfigurationProperty {
/**
* `CfnBucket.WebsiteConfigurationProperty.ErrorDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-errordocument
*/
readonly errorDocument?: string;
/**
* `CfnBucket.WebsiteConfigurationProperty.IndexDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-indexdocument
*/
readonly indexDocument?: string;
/**
* `CfnBucket.WebsiteConfigurationProperty.RedirectAllRequestsTo`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-redirectallrequeststo
*/
readonly redirectAllRequestsTo?: CfnBucket.RedirectAllRequestsToProperty | cdk.IResolvable;
/**
* `CfnBucket.WebsiteConfigurationProperty.RoutingRules`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration.html#cfn-s3-websiteconfiguration-routingrules
*/
readonly routingRules?: Array<CfnBucket.RoutingRuleProperty | cdk.IResolvable> | cdk.IResolvable;
}
}
/**
* Determine whether the given properties match those of a `WebsiteConfigurationProperty`
*
* @param properties - the TypeScript properties of a `WebsiteConfigurationProperty`
*
* @returns the result of the validation.
*/
function CfnBucket_WebsiteConfigurationPropertyValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('errorDocument', cdk.validateString)(properties.errorDocument));
errors.collect(cdk.propertyValidator('indexDocument', cdk.validateString)(properties.indexDocument));
errors.collect(cdk.propertyValidator('redirectAllRequestsTo', CfnBucket_RedirectAllRequestsToPropertyValidator)(properties.redirectAllRequestsTo));
errors.collect(cdk.propertyValidator('routingRules', cdk.listValidator(CfnBucket_RoutingRulePropertyValidator))(properties.routingRules));
return errors.wrap('supplied properties not correct for "WebsiteConfigurationProperty"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::Bucket.WebsiteConfiguration` resource
*
* @param properties - the TypeScript properties of a `WebsiteConfigurationProperty`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::Bucket.WebsiteConfiguration` resource.
*/
// @ts-ignore TS6133
function cfnBucketWebsiteConfigurationPropertyToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucket_WebsiteConfigurationPropertyValidator(properties).assertSuccess();
return {
ErrorDocument: cdk.stringToCloudFormation(properties.errorDocument),
IndexDocument: cdk.stringToCloudFormation(properties.indexDocument),
RedirectAllRequestsTo: cfnBucketRedirectAllRequestsToPropertyToCloudFormation(properties.redirectAllRequestsTo),
RoutingRules: cdk.listMapper(cfnBucketRoutingRulePropertyToCloudFormation)(properties.routingRules),
};
}
// @ts-ignore TS6133
function CfnBucketWebsiteConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucket.WebsiteConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const errorDocumentResult = properties.ErrorDocument != null ? cfn_parse.FromCloudFormation.getString(properties.ErrorDocument) : undefined;
const indexDocumentResult = properties.IndexDocument != null ? cfn_parse.FromCloudFormation.getString(properties.IndexDocument) : undefined;
const redirectAllRequestsToResult = properties.RedirectAllRequestsTo != null ? CfnBucketRedirectAllRequestsToPropertyFromCloudFormation(properties.RedirectAllRequestsTo) : undefined;
const routingRulesResult = properties.RoutingRules != null ? cfn_parse.FromCloudFormation.getArray(CfnBucketRoutingRulePropertyFromCloudFormation)(properties.RoutingRules) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
errorDocument: errorDocumentResult?.value,
indexDocument: indexDocumentResult?.value,
redirectAllRequestsTo: redirectAllRequestsToResult?.value,
routingRules: routingRulesResult?.value,
});
ret.appendExtraProperties('ErrorDocument', errorDocumentResult?.extraProperties);
ret.appendExtraProperties('IndexDocument', indexDocumentResult?.extraProperties);
ret.appendExtraProperties('RedirectAllRequestsTo', redirectAllRequestsToResult?.extraProperties);
ret.appendExtraProperties('RoutingRules', routingRulesResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ErrorDocument', 'IndexDocument', 'RedirectAllRequestsTo', 'RoutingRules'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* Properties for defining a `AWS::S3::BucketPolicy`
*
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html
*/
export interface CfnBucketPolicyProps {
/**
* `AWS::S3::BucketPolicy.Bucket`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-bucket
*/
readonly bucket: string;
/**
* `AWS::S3::BucketPolicy.PolicyDocument`
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html#aws-properties-s3-policy-policydocument
*/
readonly policyDocument: any | cdk.IResolvable;
}
/**
* Determine whether the given properties match those of a `CfnBucketPolicyProps`
*
* @param properties - the TypeScript properties of a `CfnBucketPolicyProps`
*
* @returns the result of the validation.
*/
function CfnBucketPolicyPropsValidator(properties: any): cdk.ValidationResult {
if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; }
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('bucket', cdk.requiredValidator)(properties.bucket));
errors.collect(cdk.propertyValidator('bucket', cdk.validateString)(properties.bucket));
errors.collect(cdk.propertyValidator('policyDocument', cdk.requiredValidator)(properties.policyDocument));
errors.collect(cdk.propertyValidator('policyDocument', cdk.validateObject)(properties.policyDocument));
return errors.wrap('supplied properties not correct for "CfnBucketPolicyProps"');
}
/**
* Renders the AWS CloudFormation properties of an `AWS::S3::BucketPolicy` resource
*
* @param properties - the TypeScript properties of a `CfnBucketPolicyProps`
*
* @returns the AWS CloudFormation properties of an `AWS::S3::BucketPolicy` resource.
*/
// @ts-ignore TS6133
function cfnBucketPolicyPropsToCloudFormation(properties: any): any {
if (!cdk.canInspect(properties)) { return properties; }
CfnBucketPolicyPropsValidator(properties).assertSuccess();
return {
Bucket: cdk.stringToCloudFormation(properties.bucket),
PolicyDocument: cdk.objectToCloudFormation(properties.policyDocument),
};
}
// @ts-ignore TS6133
function CfnBucketPolicyPropsFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnBucketPolicyProps> {
properties = properties || {};
const bucketResult = cfn_parse.FromCloudFormation.getString(properties.Bucket);
const policyDocumentResult = cfn_parse.FromCloudFormation.getAny(properties.PolicyDocument);
const ret = new cfn_parse.FromCloudFormationResult({
bucket: bucketResult?.value,
policyDocument: policyDocumentResult?.value,
});
ret.appendExtraProperties('Bucket', bucketResult?.extraProperties);
ret.appendExtraProperties('PolicyDocument', policyDocumentResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Bucket', 'PolicyDocument'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* 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 propsResult = CfnBucketPolicyPropsFromCloudFormation(resourceProperties);
const ret = new CfnBucketPolicy(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
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,
};
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensPropsFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLensProps> {
properties = properties || {};
const storageLensConfigurationResult = CfnStorageLensStorageLensConfigurationPropertyFromCloudFormation(properties.StorageLensConfiguration);
const tagsResult = properties.Tags != null ? cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags) : undefined as any;
const ret = new cfn_parse.FromCloudFormationResult({
storageLensConfiguration: storageLensConfigurationResult?.value,
tags: tagsResult?.value,
});
ret.appendExtraProperties('StorageLensConfiguration', storageLensConfigurationResult?.extraProperties);
ret.appendExtraProperties('Tags', tagsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'StorageLensConfiguration', 'Tags'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
/**
* 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 propsResult = CfnStorageLensPropsFromCloudFormation(resourceProperties);
const ret = new CfnStorageLens(scope, id, propsResult.value);
for (const [propKey, propVal] of Object.entries(propsResult.extraProperties)) {
ret.addPropertyOverride(propKey, propVal);
}
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(),
};
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensAccountLevelPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.AccountLevelProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const activityMetricsResult = properties.ActivityMetrics != null ? CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties.ActivityMetrics) : undefined;
const bucketLevelResult = CfnStorageLensBucketLevelPropertyFromCloudFormation(properties.BucketLevel);
const ret = new cfn_parse.FromCloudFormationResult({
activityMetrics: activityMetricsResult?.value,
bucketLevel: bucketLevelResult?.value,
});
ret.appendExtraProperties('ActivityMetrics', activityMetricsResult?.extraProperties);
ret.appendExtraProperties('BucketLevel', bucketLevelResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ActivityMetrics', 'BucketLevel'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.ActivityMetricsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const isEnabledResult = properties.IsEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
isEnabled: isEnabledResult?.value,
});
ret.appendExtraProperties('IsEnabled', isEnabledResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'IsEnabled'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensAwsOrgPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.AwsOrgProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const arnResult = cfn_parse.FromCloudFormation.getString(properties.Arn);
const ret = new cfn_parse.FromCloudFormationResult({
arn: arnResult?.value,
});
ret.appendExtraProperties('Arn', arnResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Arn'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensBucketLevelPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.BucketLevelProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const activityMetricsResult = properties.ActivityMetrics != null ? CfnStorageLensActivityMetricsPropertyFromCloudFormation(properties.ActivityMetrics) : undefined;
const prefixLevelResult = properties.PrefixLevel != null ? CfnStorageLensPrefixLevelPropertyFromCloudFormation(properties.PrefixLevel) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
activityMetrics: activityMetricsResult?.value,
prefixLevel: prefixLevelResult?.value,
});
ret.appendExtraProperties('ActivityMetrics', activityMetricsResult?.extraProperties);
ret.appendExtraProperties('PrefixLevel', prefixLevelResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'ActivityMetrics', 'PrefixLevel'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.BucketsAndRegionsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const bucketsResult = properties.Buckets != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Buckets) : undefined;
const regionsResult = properties.Regions != null ? cfn_parse.FromCloudFormation.getStringArray(properties.Regions) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
buckets: bucketsResult?.value,
regions: regionsResult?.value,
});
ret.appendExtraProperties('Buckets', bucketsResult?.extraProperties);
ret.appendExtraProperties('Regions', regionsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Buckets', 'Regions'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensDataExportPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.DataExportProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const s3BucketDestinationResult = CfnStorageLensS3BucketDestinationPropertyFromCloudFormation(properties.S3BucketDestination);
const ret = new cfn_parse.FromCloudFormationResult({
s3BucketDestination: s3BucketDestinationResult?.value,
});
ret.appendExtraProperties('S3BucketDestination', s3BucketDestinationResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'S3BucketDestination'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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 {
};
}
// @ts-ignore TS6133
function CfnStorageLensEncryptionPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.EncryptionProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const ret = new cfn_parse.FromCloudFormationResult({
});
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, ))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensPrefixLevelPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.PrefixLevelProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const storageMetricsResult = CfnStorageLensPrefixLevelStorageMetricsPropertyFromCloudFormation(properties.StorageMetrics);
const ret = new cfn_parse.FromCloudFormationResult({
storageMetrics: storageMetricsResult?.value,
});
ret.appendExtraProperties('StorageMetrics', storageMetricsResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'StorageMetrics'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensPrefixLevelStorageMetricsPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.PrefixLevelStorageMetricsProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const isEnabledResult = properties.IsEnabled != null ? cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled) : undefined;
const selectionCriteriaResult = properties.SelectionCriteria != null ? CfnStorageLensSelectionCriteriaPropertyFromCloudFormation(properties.SelectionCriteria) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
isEnabled: isEnabledResult?.value,
selectionCriteria: selectionCriteriaResult?.value,
});
ret.appendExtraProperties('IsEnabled', isEnabledResult?.extraProperties);
ret.appendExtraProperties('SelectionCriteria', selectionCriteriaResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'IsEnabled', 'SelectionCriteria'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensS3BucketDestinationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.S3BucketDestinationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const accountIdResult = cfn_parse.FromCloudFormation.getString(properties.AccountId);
const arnResult = cfn_parse.FromCloudFormation.getString(properties.Arn);
const encryptionResult = properties.Encryption != null ? CfnStorageLensEncryptionPropertyFromCloudFormation(properties.Encryption) : undefined;
const formatResult = cfn_parse.FromCloudFormation.getString(properties.Format);
const outputSchemaVersionResult = cfn_parse.FromCloudFormation.getString(properties.OutputSchemaVersion);
const prefixResult = properties.Prefix != null ? cfn_parse.FromCloudFormation.getString(properties.Prefix) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
accountId: accountIdResult?.value,
arn: arnResult?.value,
encryption: encryptionResult?.value,
format: formatResult?.value,
outputSchemaVersion: outputSchemaVersionResult?.value,
prefix: prefixResult?.value,
});
ret.appendExtraProperties('AccountId', accountIdResult?.extraProperties);
ret.appendExtraProperties('Arn', arnResult?.extraProperties);
ret.appendExtraProperties('Encryption', encryptionResult?.extraProperties);
ret.appendExtraProperties('Format', formatResult?.extraProperties);
ret.appendExtraProperties('OutputSchemaVersion', outputSchemaVersionResult?.extraProperties);
ret.appendExtraProperties('Prefix', prefixResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AccountId', 'Arn', 'Encryption', 'Format', 'OutputSchemaVersion', 'Prefix'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensSelectionCriteriaPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.SelectionCriteriaProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const delimiterResult = properties.Delimiter != null ? cfn_parse.FromCloudFormation.getString(properties.Delimiter) : undefined;
const maxDepthResult = properties.MaxDepth != null ? cfn_parse.FromCloudFormation.getNumber(properties.MaxDepth) : undefined;
const minStorageBytesPercentageResult = properties.MinStorageBytesPercentage != null ? cfn_parse.FromCloudFormation.getNumber(properties.MinStorageBytesPercentage) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
delimiter: delimiterResult?.value,
maxDepth: maxDepthResult?.value,
minStorageBytesPercentage: minStorageBytesPercentageResult?.value,
});
ret.appendExtraProperties('Delimiter', delimiterResult?.extraProperties);
ret.appendExtraProperties('MaxDepth', maxDepthResult?.extraProperties);
ret.appendExtraProperties('MinStorageBytesPercentage', minStorageBytesPercentageResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'Delimiter', 'MaxDepth', 'MinStorageBytesPercentage'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
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),
};
}
// @ts-ignore TS6133
function CfnStorageLensStorageLensConfigurationPropertyFromCloudFormation(properties: any): cfn_parse.FromCloudFormationResult<CfnStorageLens.StorageLensConfigurationProperty | cdk.IResolvable> {
if (cdk.isResolvableObject(properties)) {
return new cfn_parse.FromCloudFormationResult(properties);
}
properties = properties || {};
const accountLevelResult = CfnStorageLensAccountLevelPropertyFromCloudFormation(properties.AccountLevel);
const awsOrgResult = properties.AwsOrg != null ? CfnStorageLensAwsOrgPropertyFromCloudFormation(properties.AwsOrg) : undefined;
const dataExportResult = properties.DataExport != null ? CfnStorageLensDataExportPropertyFromCloudFormation(properties.DataExport) : undefined;
const excludeResult = properties.Exclude != null ? CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties.Exclude) : undefined;
const idResult = cfn_parse.FromCloudFormation.getString(properties.Id);
const includeResult = properties.Include != null ? CfnStorageLensBucketsAndRegionsPropertyFromCloudFormation(properties.Include) : undefined;
const isEnabledResult = cfn_parse.FromCloudFormation.getBoolean(properties.IsEnabled);
const storageLensArnResult = properties.StorageLensArn != null ? cfn_parse.FromCloudFormation.getString(properties.StorageLensArn) : undefined;
const ret = new cfn_parse.FromCloudFormationResult({
accountLevel: accountLevelResult?.value,
awsOrg: awsOrgResult?.value,
dataExport: dataExportResult?.value,
exclude: excludeResult?.value,
id: idResult?.value,
include: includeResult?.value,
isEnabled: isEnabledResult?.value,
storageLensArn: storageLensArnResult?.value,
});
ret.appendExtraProperties('AccountLevel', accountLevelResult?.extraProperties);
ret.appendExtraProperties('AwsOrg', awsOrgResult?.extraProperties);
ret.appendExtraProperties('DataExport', dataExportResult?.extraProperties);
ret.appendExtraProperties('Exclude', excludeResult?.extraProperties);
ret.appendExtraProperties('Id', idResult?.extraProperties);
ret.appendExtraProperties('Include', includeResult?.extraProperties);
ret.appendExtraProperties('IsEnabled', isEnabledResult?.extraProperties);
ret.appendExtraProperties('StorageLensArn', storageLensArnResult?.extraProperties);
for (const [key, val] of Object.entries(cfn_parse.FromCloudFormation.omit(properties, 'AccountLevel', 'AwsOrg', 'DataExport', 'Exclude', 'Id', 'Include', 'IsEnabled', 'StorageLensArn'))) {
ret.appendExtraProperty(key, val);
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment