From 0a9c6db3dea42e6343b0a9ee4eb50ab447051148 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Fri, 6 Mar 2020 17:22:38 +0100 Subject: [PATCH] feat(cfnspec): cloudformation spec v11.3.0 (#6598) see CHANGELOG --- packages/@aws-cdk/cfnspec/CHANGELOG.md | 62 ++++ .../@aws-cdk/cfnspec/build-tools/build.ts | 26 +- packages/@aws-cdk/cfnspec/cfn.version | 2 +- ...0_CloudFormationResourceSpecification.json | 302 +++++++++++++++++- .../cfnspec/spec-source/000_sam.spec.json | 18 ++ .../@aws-cdk/cfnspec/test/spec-validators.ts | 2 +- packages/@aws-cdk/cfnspec/test/test.build.ts | 68 ++++ packages/decdk/package.json | 2 +- packages/monocdk-experiment/package.json | 2 +- 9 files changed, 477 insertions(+), 7 deletions(-) create mode 100644 packages/@aws-cdk/cfnspec/test/test.build.ts diff --git a/packages/@aws-cdk/cfnspec/CHANGELOG.md b/packages/@aws-cdk/cfnspec/CHANGELOG.md index 22bc1db55fe29..7f7739c0490f4 100644 --- a/packages/@aws-cdk/cfnspec/CHANGELOG.md +++ b/packages/@aws-cdk/cfnspec/CHANGELOG.md @@ -1,3 +1,65 @@ +# CloudFormation Resource Specification v11.3.0 + +## New Resource Types + +* AWS::CloudWatch::CompositeAlarm + +## Attribute Changes + +* AWS::AppMesh::Mesh MeshOwner (__added__) +* AWS::AppMesh::Mesh ResourceOwner (__added__) +* AWS::AppMesh::Route MeshOwner (__added__) +* AWS::AppMesh::Route ResourceOwner (__added__) +* AWS::AppMesh::VirtualNode MeshOwner (__added__) +* AWS::AppMesh::VirtualNode ResourceOwner (__added__) +* AWS::AppMesh::VirtualRouter MeshOwner (__added__) +* AWS::AppMesh::VirtualRouter ResourceOwner (__added__) +* AWS::AppMesh::VirtualService MeshOwner (__added__) +* AWS::AppMesh::VirtualService ResourceOwner (__added__) + +## Property Changes + + +## Property Type Changes + +* AWS::AppMesh::VirtualNode.BackendDefaults (__added__) +* AWS::AppMesh::VirtualNode.ClientPolicy (__added__) +* AWS::AppMesh::VirtualNode.ClientPolicyTls (__added__) +* AWS::AppMesh::VirtualNode.ListenerTls (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsAcmCertificate (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsCertificate (__added__) +* AWS::AppMesh::VirtualNode.ListenerTlsFileCertificate (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContext (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContextAcmTrust (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContextFileTrust (__added__) +* AWS::AppMesh::VirtualNode.TlsValidationContextTrust (__added__) +* AWS::Greengrass::ResourceDefinition.ResourceDownloadOwnerSetting (__added__) +* AWS::Greengrass::ResourceDefinitionVersion.ResourceDownloadOwnerSetting (__added__) +* AWS::AppMesh::VirtualNode.Listener TLS (__added__) +* AWS::AppMesh::VirtualNode.VirtualNodeSpec BackendDefaults (__added__) +* AWS::AppMesh::VirtualNode.VirtualServiceBackend ClientPolicy (__added__) +* AWS::Greengrass::ResourceDefinition.S3MachineLearningModelResourceData OwnerSetting (__added__) +* AWS::Greengrass::ResourceDefinition.SageMakerMachineLearningModelResourceData OwnerSetting (__added__) +* AWS::Greengrass::ResourceDefinitionVersion.S3MachineLearningModelResourceData OwnerSetting (__added__) +* AWS::Greengrass::ResourceDefinitionVersion.SageMakerMachineLearningModelResourceData OwnerSetting (__added__) + +# Serverless Application Model (SAM) Resource Specification v2016-10-31 + +## New Resource Types + + +## Attribute Changes + + +## Property Changes + + +## Property Type Changes + +* AWS::Serverless::Function.CloudWatchLogsEvent (__added__) +* AWS::Serverless::Function.EventSource Properties.Types (__changed__) + * Added CloudWatchLogsEvent + # CloudFormation Resource Specification v11.1.0 ## New Resource Types diff --git a/packages/@aws-cdk/cfnspec/build-tools/build.ts b/packages/@aws-cdk/cfnspec/build-tools/build.ts index d65f2f53fe6a4..5b2910f12d7c4 100644 --- a/packages/@aws-cdk/cfnspec/build-tools/build.ts +++ b/packages/@aws-cdk/cfnspec/build-tools/build.ts @@ -26,8 +26,7 @@ async function main() { } } - detectScrutinyTypes(spec); - replaceIncompleteTypes(spec); + massageSpec(spec); spec.Fingerprint = md5(JSON.stringify(normalize(spec))); @@ -36,6 +35,12 @@ async function main() { await fs.writeJson(path.join(outDir, 'specification.json'), spec, { spaces: 2 }); } +export function massageSpec(spec: schema.Specification) { + detectScrutinyTypes(spec); + replaceIncompleteTypes(spec); + dropTypelessAttributes(spec); +} + function forEachSection(spec: schema.Specification, data: any, cb: (spec: any, fragment: any, path: string[]) => void) { cb(spec.PropertyTypes, data.PropertyTypes, ['PropertyTypes']); cb(spec.ResourceTypes, data.ResourceTypes, ['ResourceTypes']); @@ -74,6 +79,23 @@ function replaceIncompleteTypes(spec: schema.Specification) { } } +/** + * Drop Attributes specified with the different ResourceTypes that have + * no type specified. + */ +function dropTypelessAttributes(spec: schema.Specification) { + const resourceTypes = spec.ResourceTypes; + Object.values(resourceTypes).forEach((resourceType) => { + const attributes = resourceType.Attributes ?? {}; + Object.keys(attributes).forEach((attrKey) => { + const attrVal = attributes[attrKey]; + if (Object.keys(attrVal).length === 0) { + delete attributes[attrKey]; + } + }); + }); +} + function merge(spec: any, fragment: any, jsonPath: string[]) { if (!fragment) { return; } for (const key of Object.keys(fragment)) { diff --git a/packages/@aws-cdk/cfnspec/cfn.version b/packages/@aws-cdk/cfnspec/cfn.version index 68d8f15e23cf5..f628d2eafc5e5 100644 --- a/packages/@aws-cdk/cfnspec/cfn.version +++ b/packages/@aws-cdk/cfnspec/cfn.version @@ -1 +1 @@ -11.1.0 +11.3.0 diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json index 00eda8574624a..2284434892c24 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_CloudFormationResourceSpecification.json @@ -2068,6 +2068,52 @@ } } }, + "AWS::AppMesh::VirtualNode.BackendDefaults": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-backenddefaults.html", + "Properties": { + "ClientPolicy": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-backenddefaults.html#cfn-appmesh-virtualnode-backenddefaults-clientpolicy", + "Required": false, + "Type": "ClientPolicy", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ClientPolicy": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicy.html", + "Properties": { + "TLS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicy.html#cfn-appmesh-virtualnode-clientpolicy-tls", + "Required": false, + "Type": "ClientPolicyTls", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ClientPolicyTls": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html", + "Properties": { + "Enforce": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html#cfn-appmesh-virtualnode-clientpolicytls-enforce", + "PrimitiveType": "Boolean", + "Required": false, + "UpdateType": "Mutable" + }, + "Ports": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html#cfn-appmesh-virtualnode-clientpolicytls-ports", + "PrimitiveItemType": "Integer", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "Validation": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-clientpolicytls.html#cfn-appmesh-virtualnode-clientpolicytls-validation", + "Required": true, + "Type": "TlsValidationContext", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.DnsServiceDiscovery": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-dnsservicediscovery.html", "Properties": { @@ -2151,6 +2197,74 @@ "Required": true, "Type": "PortMapping", "UpdateType": "Mutable" + }, + "TLS": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listener.html#cfn-appmesh-virtualnode-listener-tls", + "Required": false, + "Type": "ListenerTls", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTls": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertls.html", + "Properties": { + "Certificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertls.html#cfn-appmesh-virtualnode-listenertls-certificate", + "Required": true, + "Type": "ListenerTlsCertificate", + "UpdateType": "Mutable" + }, + "Mode": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertls.html#cfn-appmesh-virtualnode-listenertls-mode", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTlsAcmCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsacmcertificate.html", + "Properties": { + "CertificateArn": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsacmcertificate.html#cfn-appmesh-virtualnode-listenertlsacmcertificate-certificatearn", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTlsCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlscertificate.html", + "Properties": { + "ACM": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlscertificate.html#cfn-appmesh-virtualnode-listenertlscertificate-acm", + "Required": false, + "Type": "ListenerTlsAcmCertificate", + "UpdateType": "Mutable" + }, + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlscertificate.html#cfn-appmesh-virtualnode-listenertlscertificate-file", + "Required": false, + "Type": "ListenerTlsFileCertificate", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.ListenerTlsFileCertificate": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsfilecertificate.html", + "Properties": { + "CertificateChain": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsfilecertificate.html#cfn-appmesh-virtualnode-listenertlsfilecertificate-certificatechain", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "PrivateKey": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-listenertlsfilecertificate.html#cfn-appmesh-virtualnode-listenertlsfilecertificate-privatekey", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" } } }, @@ -2199,9 +2313,66 @@ } } }, + "AWS::AppMesh::VirtualNode.TlsValidationContext": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontext.html", + "Properties": { + "Trust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontext.html#cfn-appmesh-virtualnode-tlsvalidationcontext-trust", + "Required": true, + "Type": "TlsValidationContextTrust", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.TlsValidationContextAcmTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextacmtrust.html", + "Properties": { + "CertificateAuthorityArns": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextacmtrust.html#cfn-appmesh-virtualnode-tlsvalidationcontextacmtrust-certificateauthorityarns", + "PrimitiveItemType": "String", + "Required": true, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.TlsValidationContextFileTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextfiletrust.html", + "Properties": { + "CertificateChain": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextfiletrust.html#cfn-appmesh-virtualnode-tlsvalidationcontextfiletrust-certificatechain", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + } + } + }, + "AWS::AppMesh::VirtualNode.TlsValidationContextTrust": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontexttrust.html", + "Properties": { + "ACM": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontexttrust.html#cfn-appmesh-virtualnode-tlsvalidationcontexttrust-acm", + "Required": false, + "Type": "TlsValidationContextAcmTrust", + "UpdateType": "Mutable" + }, + "File": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontexttrust.html#cfn-appmesh-virtualnode-tlsvalidationcontexttrust-file", + "Required": false, + "Type": "TlsValidationContextFileTrust", + "UpdateType": "Mutable" + } + } + }, "AWS::AppMesh::VirtualNode.VirtualNodeSpec": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualnodespec.html", "Properties": { + "BackendDefaults": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualnodespec.html#cfn-appmesh-virtualnode-virtualnodespec-backenddefaults", + "Required": false, + "Type": "BackendDefaults", + "UpdateType": "Mutable" + }, "Backends": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualnodespec.html#cfn-appmesh-virtualnode-virtualnodespec-backends", "ItemType": "Backend", @@ -2233,6 +2404,12 @@ "AWS::AppMesh::VirtualNode.VirtualServiceBackend": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualservicebackend.html", "Properties": { + "ClientPolicy": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualservicebackend.html#cfn-appmesh-virtualnode-virtualservicebackend-clientpolicy", + "Required": false, + "Type": "ClientPolicy", + "UpdateType": "Mutable" + }, "VirtualServiceName": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-virtualservicebackend.html#cfn-appmesh-virtualnode-virtualservicebackend-virtualservicename", "PrimitiveType": "String", @@ -17649,6 +17826,23 @@ } } }, + "AWS::Greengrass::ResourceDefinition.ResourceDownloadOwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-resourcedownloadownersetting.html", + "Properties": { + "GroupOwner": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-resourcedownloadownersetting.html#cfn-greengrass-resourcedefinition-resourcedownloadownersetting-groupowner", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "GroupPermission": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-resourcedownloadownersetting.html#cfn-greengrass-resourcedefinition-resourcedownloadownersetting-grouppermission", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::Greengrass::ResourceDefinition.ResourceInstance": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-resourceinstance.html", "Properties": { @@ -17681,6 +17875,12 @@ "Required": true, "UpdateType": "Immutable" }, + "OwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-s3machinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinition-s3machinelearningmodelresourcedata-ownersetting", + "Required": false, + "Type": "ResourceDownloadOwnerSetting", + "UpdateType": "Immutable" + }, "S3Uri": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-s3machinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinition-s3machinelearningmodelresourcedata-s3uri", "PrimitiveType": "String", @@ -17698,6 +17898,12 @@ "Required": true, "UpdateType": "Immutable" }, + "OwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-sagemakermachinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinition-sagemakermachinelearningmodelresourcedata-ownersetting", + "Required": false, + "Type": "ResourceDownloadOwnerSetting", + "UpdateType": "Immutable" + }, "SageMakerJobArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinition-sagemakermachinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinition-sagemakermachinelearningmodelresourcedata-sagemakerjobarn", "PrimitiveType": "String", @@ -17816,6 +18022,23 @@ } } }, + "AWS::Greengrass::ResourceDefinitionVersion.ResourceDownloadOwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-resourcedownloadownersetting.html", + "Properties": { + "GroupOwner": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-resourcedownloadownersetting.html#cfn-greengrass-resourcedefinitionversion-resourcedownloadownersetting-groupowner", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "GroupPermission": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-resourcedownloadownersetting.html#cfn-greengrass-resourcedefinitionversion-resourcedownloadownersetting-grouppermission", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::Greengrass::ResourceDefinitionVersion.ResourceInstance": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-resourceinstance.html", "Properties": { @@ -17848,6 +18071,12 @@ "Required": true, "UpdateType": "Immutable" }, + "OwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-s3machinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinitionversion-s3machinelearningmodelresourcedata-ownersetting", + "Required": false, + "Type": "ResourceDownloadOwnerSetting", + "UpdateType": "Immutable" + }, "S3Uri": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-s3machinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinitionversion-s3machinelearningmodelresourcedata-s3uri", "PrimitiveType": "String", @@ -17865,6 +18094,12 @@ "Required": true, "UpdateType": "Immutable" }, + "OwnerSetting": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-sagemakermachinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinitionversion-sagemakermachinelearningmodelresourcedata-ownersetting", + "Required": false, + "Type": "ResourceDownloadOwnerSetting", + "UpdateType": "Immutable" + }, "SageMakerJobArn": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-greengrass-resourcedefinitionversion-sagemakermachinelearningmodelresourcedata.html#cfn-greengrass-resourcedefinitionversion-sagemakermachinelearningmodelresourcedata-sagemakerjobarn", "PrimitiveType": "String", @@ -29912,7 +30147,7 @@ } } }, - "ResourceSpecificationVersion": "11.1.0", + "ResourceSpecificationVersion": "11.3.0", "ResourceTypes": { "AWS::ACMPCA::Certificate": { "Attributes": { @@ -32149,6 +32384,8 @@ "MeshName": { "PrimitiveType": "String" }, + "MeshOwner": {}, + "ResourceOwner": {}, "Uid": { "PrimitiveType": "String" } @@ -32184,6 +32421,8 @@ "MeshName": { "PrimitiveType": "String" }, + "MeshOwner": {}, + "ResourceOwner": {}, "RouteName": { "PrimitiveType": "String" }, @@ -32237,6 +32476,8 @@ "MeshName": { "PrimitiveType": "String" }, + "MeshOwner": {}, + "ResourceOwner": {}, "Uid": { "PrimitiveType": "String" }, @@ -32281,6 +32522,8 @@ "MeshName": { "PrimitiveType": "String" }, + "MeshOwner": {}, + "ResourceOwner": {}, "Uid": { "PrimitiveType": "String" }, @@ -32325,6 +32568,8 @@ "MeshName": { "PrimitiveType": "String" }, + "MeshOwner": {}, + "ResourceOwner": {}, "Uid": { "PrimitiveType": "String" }, @@ -34521,6 +34766,61 @@ } } }, + "AWS::CloudWatch::CompositeAlarm": { + "Attributes": { + "Arn": { + "PrimitiveType": "String" + } + }, + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html", + "Properties": { + "ActionsEnabled": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-actionsenabled", + "PrimitiveType": "Boolean", + "Required": false, + "UpdateType": "Mutable" + }, + "AlarmActions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmactions", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "AlarmDescription": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmdescription", + "PrimitiveType": "String", + "Required": false, + "UpdateType": "Mutable" + }, + "AlarmName": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmname", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "AlarmRule": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-alarmrule", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Mutable" + }, + "InsufficientDataActions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-insufficientdataactions", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + }, + "OKActions": { + "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-compositealarm.html#cfn-cloudwatch-compositealarm-okactions", + "PrimitiveItemType": "String", + "Required": false, + "Type": "List", + "UpdateType": "Mutable" + } + } + }, "AWS::CloudWatch::Dashboard": { "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-dashboard.html", "Properties": { diff --git a/packages/@aws-cdk/cfnspec/spec-source/000_sam.spec.json b/packages/@aws-cdk/cfnspec/spec-source/000_sam.spec.json index 4605ed2151a38..2dd18618067a8 100644 --- a/packages/@aws-cdk/cfnspec/spec-source/000_sam.spec.json +++ b/packages/@aws-cdk/cfnspec/spec-source/000_sam.spec.json @@ -178,6 +178,23 @@ } } }, + "AWS::Serverless::Function.CloudWatchLogsEvent": { + "Documentation": "https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#cloudwatchevent", + "Properties": { + "FilterPattern": { + "Documentation": "https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#cloudwatchlogs", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + }, + "LogGroupName": { + "Documentation": "https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#cloudwatchlogs", + "PrimitiveType": "String", + "Required": true, + "UpdateType": "Immutable" + } + } + }, "AWS::Serverless::Function.CollectionSAMPT": { "Documentation": "https://github.com/awslabs/serverless-application-model/blob/master/docs/policy_templates.rst", "Properties": { @@ -302,6 +319,7 @@ "ApiEvent", "ScheduleEvent", "CloudWatchEventEvent", + "CloudWatchLogsEvent", "IoTRuleEvent", "AlexaSkillEvent" ], diff --git a/packages/@aws-cdk/cfnspec/test/spec-validators.ts b/packages/@aws-cdk/cfnspec/test/spec-validators.ts index 04fd388210fba..7506d5e1da77d 100644 --- a/packages/@aws-cdk/cfnspec/test/spec-validators.ts +++ b/packages/@aws-cdk/cfnspec/test/spec-validators.ts @@ -120,7 +120,7 @@ function validateAttributes(typeName: string, specification: schema.Specification) { for (const name of Object.keys(attributes)) { const attribute = attributes[name]; - test.ok(('Type' in attribute) !== ('PrimitiveType' in attribute)); + test.ok(('Type' in attribute) !== ('PrimitiveType' in attribute), 'One of, and only one of, Type or PrimitiveType must be present'); if (schema.isPrimitiveAttribute(attribute)) { test.ok(!schema.isListAttribute(attribute), `${typeName}.Attributes.${name} is only a Primitive type`); test.ok(schema.isPrimitiveType(attribute.PrimitiveType), `${typeName}.Attributes.${name} has a valid PrimitiveType`); diff --git a/packages/@aws-cdk/cfnspec/test/test.build.ts b/packages/@aws-cdk/cfnspec/test/test.build.ts new file mode 100644 index 0000000000000..ba7364b7075d8 --- /dev/null +++ b/packages/@aws-cdk/cfnspec/test/test.build.ts @@ -0,0 +1,68 @@ +import { Test } from 'nodeunit'; +import { massageSpec } from '../build-tools/build'; +import { schema } from '../lib'; + +export = { + 'dropTypelessAttributes works correctly'(test: Test) { + const spec: schema.Specification = { + Fingerprint: 'some-fingerprint', + PropertyTypes: { + 'CDK::Test::Property': { + Properties: { + Type: ({ + PrimitiveType: "String", + } as schema.ScalarProperty), // ts is being weird and doesn't correctly match the type + }, + } + }, + ResourceTypes: { + 'CDK::Test::Resource': { + Attributes: { + Attribute1: ({ + PrimitiveType: 'String' + } as schema.PrimitiveAttribute), // ts is being weird and doesn't correctly match the type + Attribute2: ({} as schema.PrimitiveAttribute), + }, + Documentation: "https://documentation-url/cdk/test/resource", + Properties: { + ResourceArn: ({ + PrimitiveType: "String", + } as schema.PrimitiveProperty), // ts is being weird and doesn't correctly match the type + } + } + } + }; + + massageSpec(spec); + + test.deepEqual(spec, { + Fingerprint: 'some-fingerprint', + PropertyTypes: { + 'CDK::Test::Property': { + Properties: { + Type: ({ + PrimitiveType: "String", + } as schema.ScalarProperty), // ts is being weird and doesn't correctly match the type + }, + } + }, + ResourceTypes: { + 'CDK::Test::Resource': { + Attributes: { + Attribute1: ({ + PrimitiveType: 'String' + }), + }, + Documentation: "https://documentation-url/cdk/test/resource", + Properties: { + ResourceArn: { + PrimitiveType: "String", + }, + } + } + } + }); + + test.done(); + } +}; diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 67557c0f9ab45..310ed6c10618e 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -185,4 +185,4 @@ "engines": { "node": ">= 8.10.0" } -} \ No newline at end of file +} diff --git a/packages/monocdk-experiment/package.json b/packages/monocdk-experiment/package.json index 905fc3009d753..b2c4fb659b230 100644 --- a/packages/monocdk-experiment/package.json +++ b/packages/monocdk-experiment/package.json @@ -164,4 +164,4 @@ "engines": { "node": ">= 10.3.0" } -} \ No newline at end of file +}