Skip to content

Commit

Permalink
feat(cfnspec): cloudformation spec v16.1.0 (aws#9074)
Browse files Browse the repository at this point in the history
* feat: cloudformation spec v16.1.0

* chore: accept string maps as outputs when validating schema

* add missing attributes to amplify domain

* fix rds issue

Co-authored-by: AWS CDK Team <aws-cdk@amazon.com>
Co-authored-by: Elad Ben-Israel <benisrae@amazon.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 22, 2020
1 parent c4818fe commit d1ca04f
Show file tree
Hide file tree
Showing 7 changed files with 825 additions and 26 deletions.
26 changes: 25 additions & 1 deletion packages/@aws-cdk/aws-amplify/lib/domain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Construct, Lazy, Resource } from '@aws-cdk/core';
import { Construct, Lazy, Resource, IResolvable } from '@aws-cdk/core';
import { CfnDomain } from './amplify.generated';
import { IApp } from './app';
import { IBranch } from './branch';
Expand Down Expand Up @@ -72,6 +72,27 @@ export class Domain extends Resource {
*/
public readonly statusReason: string;

/**
* Branch patterns for the automatically created subdomain.
*
* @attribute
*/
public readonly domainAutoSubDomainCreationPatterns: string[];

/**
* The IAM service role for the subdomain.
*
* @attribute
*/
public readonly domainAutoSubDomainIamRole: string;

/**
* Specifies whether the automated creation of subdomains for branches is enabled.
*
* @attribute
*/
public readonly domainEnableAutoSubDomain: IResolvable;

private readonly subDomains: SubDomain[];

constructor(scope: Construct, id: string, props: DomainProps) {
Expand All @@ -91,6 +112,9 @@ export class Domain extends Resource {
this.domainName = domain.attrDomainName;
this.domainStatus = domain.attrDomainStatus;
this.statusReason = domain.attrStatusReason;
this.domainAutoSubDomainCreationPatterns = domain.attrAutoSubDomainCreationPatterns;
this.domainAutoSubDomainIamRole = domain.attrAutoSubDomainIamRole;
this.domainEnableAutoSubDomain = domain.attrEnableAutoSubDomain;
}

/**
Expand Down
7 changes: 2 additions & 5 deletions packages/@aws-cdk/aws-rds/lib/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,13 @@ export class DatabaseProxy extends cdk.Resource
throw new Error('Cannot specify both dbInstanceIdentifiers and dbClusterIdentifiers');
}

const proxyTargetGroup = new CfnDBProxyTargetGroup(this, 'ProxyTargetGroup', {
new CfnDBProxyTargetGroup(this, 'ProxyTargetGroup', {
targetGroupName: 'default',
dbProxyName: this.dbProxyName,
dbInstanceIdentifiers,
dbClusterIdentifiers,
connectionPoolConfigurationInfo: toConnectionPoolConfigurationInfo(props),
});

// Currently(2020-07-04), this property must be set to default.
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbproxytargetgroup.html#TargetGroupName-fn::getatt
proxyTargetGroup.addOverride('Properties.TargetGroupName', 'default');
}

/**
Expand Down
112 changes: 112 additions & 0 deletions packages/@aws-cdk/cfnspec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,115 @@
# CloudFormation Resource Specification v16.1.0

## New Resource Types

* AWS::Athena::DataCatalog
* AWS::EC2::PrefixList
* AWS::QLDB::Stream

## Attribute Changes

* AWS::Amplify::Domain AutoSubDomainCreationPatterns (__added__)
* AWS::Amplify::Domain AutoSubDomainIAMRole (__added__)
* AWS::Amplify::Domain EnableAutoSubDomain (__added__)
* AWS::RDS::DBProxyTargetGroup TargetGroupName (__deleted__)
* AWS::ServiceCatalog::CloudFormationProvisionedProduct Outputs (__added__)
* AWS::ServiceCatalog::CloudFormationProvisionedProduct ProvisionedProductId (__added__)

## Property Changes

* AWS::Amplify::App EnableBranchAutoDeletion (__added__)
* AWS::Amplify::Domain AutoSubDomainCreationPatterns (__added__)
* AWS::Amplify::Domain AutoSubDomainIAMRole (__added__)
* AWS::Amplify::Domain EnableAutoSubDomain (__added__)
* AWS::AutoScaling::AutoScalingGroup NewInstancesProtectedFromScaleIn (__added__)
* AWS::CodeGuruProfiler::ProfilingGroup ComputePlatform (__added__)
* AWS::ElastiCache::ReplicationGroup MultiAZEnabled.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::ElasticLoadBalancingV2::Listener AlpnPolicy (__added__)
* AWS::Elasticsearch::Domain AdvancedSecurityOptions (__added__)
* AWS::Elasticsearch::Domain DomainEndpointOptions (__added__)
* AWS::FSx::FileSystem StorageCapacity.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::ImageBuilder::Component SupportedOsVersions (__added__)
* AWS::ImageBuilder::Image EnhancedImageMetadataEnabled (__added__)
* AWS::ImageBuilder::ImagePipeline EnhancedImageMetadataEnabled (__added__)
* AWS::ImageBuilder::ImageRecipe WorkingDirectory (__added__)
* AWS::Lambda::Function FileSystemConfigs (__added__)
* AWS::RDS::DBProxyTargetGroup TargetGroupName (__added__)
* AWS::RDS::DBProxyTargetGroup DBProxyName.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::Route53::HealthCheck HealthCheckConfig.UpdateType (__changed__)
* Old: Mutable
* New: Conditional
* AWS::SSM::Association ApplyOnlyAtCronInterval (__added__)
* AWS::SageMaker::EndpointConfig DataCaptureConfig (__added__)
* AWS::ServiceCatalog::CloudFormationProvisionedProduct NotificationArns.DuplicatesAllowed (__added__)
* AWS::ServiceDiscovery::HttpNamespace Tags.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::ServiceDiscovery::PrivateDnsNamespace Tags.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::ServiceDiscovery::PublicDnsNamespace Tags.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::ServiceDiscovery::Service Tags.UpdateType (__changed__)
* Old: Mutable
* New: Immutable
* AWS::Synthetics::Canary RunConfig.Required (__changed__)
* Old: true
* New: false

## Property Type Changes

* AWS::CodeBuild::Project.BuildStatusConfig (__added__)
* AWS::Elasticsearch::Domain.AdvancedSecurityOptionsInput (__added__)
* AWS::Elasticsearch::Domain.DomainEndpointOptions (__added__)
* AWS::Elasticsearch::Domain.MasterUserOptions (__added__)
* AWS::Lambda::Function.FileSystemConfig (__added__)
* AWS::SageMaker::EndpointConfig.CaptureContentTypeHeader (__added__)
* AWS::SageMaker::EndpointConfig.CaptureOption (__added__)
* AWS::SageMaker::EndpointConfig.DataCaptureConfig (__added__)
* AWS::WAFv2::RuleGroup.ForwardedIPConfiguration (__added__)
* AWS::WAFv2::RuleGroup.IPSetForwardedIPConfiguration (__added__)
* AWS::WAFv2::WebACL.ForwardedIPConfiguration (__added__)
* AWS::WAFv2::WebACL.IPSetForwardedIPConfiguration (__added__)
* AWS::CodeBuild::Project.Source BuildStatusConfig (__added__)
* AWS::FSx::FileSystem.LustreConfiguration AutomaticBackupRetentionDays (__added__)
* AWS::FSx::FileSystem.LustreConfiguration CopyTagsToBackups (__added__)
* AWS::FSx::FileSystem.LustreConfiguration DailyAutomaticBackupStartTime (__added__)
* AWS::FSx::FileSystem.WindowsConfiguration ThroughputCapacity.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::SageMaker::Model.ContainerDefinition ModelPackageName (__added__)
* AWS::SageMaker::Model.ContainerDefinition Image.Required (__changed__)
* Old: true
* New: false
* AWS::ServiceCatalog::CloudFormationProvisionedProduct.ProvisioningParameter Key.Required (__changed__)
* Old: false
* New: true
* AWS::ServiceCatalog::CloudFormationProvisionedProduct.ProvisioningParameter Value.Required (__changed__)
* Old: false
* New: true
* AWS::ServiceCatalog::CloudFormationProvisionedProduct.ProvisioningPreferences StackSetAccounts.DuplicatesAllowed (__added__)
* AWS::ServiceCatalog::CloudFormationProvisionedProduct.ProvisioningPreferences StackSetRegions.DuplicatesAllowed (__added__)
* AWS::Synthetics::Canary.RunConfig MemoryInMB (__added__)
* AWS::Synthetics::Canary.Schedule DurationInSeconds.Required (__changed__)
* Old: true
* New: false
* AWS::WAFv2::RuleGroup.GeoMatchStatement ForwardedIPConfig (__added__)
* AWS::WAFv2::RuleGroup.IPSetReferenceStatement IPSetForwardedIPConfig (__added__)
* AWS::WAFv2::RuleGroup.RateBasedStatementOne ForwardedIPConfig (__added__)
* AWS::WAFv2::RuleGroup.RateBasedStatementTwo ForwardedIPConfig (__added__)
* AWS::WAFv2::WebACL.GeoMatchStatement ForwardedIPConfig (__added__)
* AWS::WAFv2::WebACL.IPSetReferenceStatement IPSetForwardedIPConfig (__added__)
* AWS::WAFv2::WebACL.RateBasedStatementOne ForwardedIPConfig (__added__)
* AWS::WAFv2::WebACL.RateBasedStatementTwo ForwardedIPConfig (__added__)


# CloudFormation Resource Specification v16.0.0

## New Resource Types
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cfnspec/cfn.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.0.0
16.1.0
17 changes: 16 additions & 1 deletion packages/@aws-cdk/cfnspec/lib/schema/resource-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface TaggableResource extends ResourceType {
}
}

export type Attribute = PrimitiveAttribute | ListAttribute;
export type Attribute = PrimitiveAttribute | ListAttribute | MapAttribute;

export interface PrimitiveAttribute {
PrimitiveType: PrimitiveType;
Expand All @@ -56,6 +56,13 @@ export interface ComplexListAttribute {
ItemType: string;
}

export type MapAttribute = PrimitiveMapAttribute;

export interface PrimitiveMapAttribute {
Type: 'Map';
PrimitiveItemType: PrimitiveType;
}

/**
* Determine if the resource supports tags
*
Expand Down Expand Up @@ -83,6 +90,10 @@ export function isListAttribute(spec: Attribute): spec is ListAttribute {
return (spec as ListAttribute).Type === 'List';
}

export function isMapAttribute(spec: Attribute): spec is MapAttribute {
return (spec as MapAttribute).Type === 'Map';
}

export function isPrimitiveListAttribute(spec: Attribute): spec is PrimitiveListAttribute {
return isListAttribute(spec) && !!(spec as PrimitiveListAttribute).PrimitiveItemType;
}
Expand All @@ -91,6 +102,10 @@ export function isComplexListAttribute(spec: Attribute): spec is ComplexListAttr
return isListAttribute(spec) && !!(spec as ComplexListAttribute).ItemType;
}

export function isPrimitiveMapAttribute(spec: Attribute): spec is PrimitiveMapAttribute {
return isMapAttribute(spec) && !!(spec as PrimitiveMapAttribute).PrimitiveItemType;
}

/**
* Type declaration for special values of the "Ref" attribute represents.
*
Expand Down
Loading

0 comments on commit d1ca04f

Please sign in to comment.