Skip to content

Commit

Permalink
Merge branch 'v1-main' into automation/yarn-upgrade-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo authored Sep 24, 2022
2 parents c5a95c1 + 27afee8 commit da9caaf
Show file tree
Hide file tree
Showing 203 changed files with 434 additions and 216 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.174.0](https://github.com/aws/aws-cdk/compare/v1.173.0...v1.174.0) (2022-09-21)


### Features

* **cfnspec:** cloudformation spec v89.0.0 ([#22106](https://github.com/aws/aws-cdk/issues/22106)) ([71cf218](https://github.com/aws/aws-cdk/commit/71cf2181897bb0aacd34d5b5cf018e8ab19910f7))

## [1.173.0](https://github.com/aws/aws-cdk/compare/v1.172.0...v1.173.0) (2022-09-15)


Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ this capability, please see the
* [Changelog](./CHANGELOG.md)
* [NOTICE](./NOTICE)
* [License](./LICENSE)

62 changes: 61 additions & 1 deletion packages/@aws-cdk/aws-ec2/lib/vpn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IVpc, SubnetSelection } from './vpc';
export interface IVpnConnection extends IResource {
/**
* The id of the VPN connection.
* @attribute VpnConnectionId
*/
readonly vpnId: string;

Expand Down Expand Up @@ -177,12 +178,71 @@ export class VpnGateway extends Resource implements IVpnGateway {
this.gatewayId = vpnGW.ref;
}
}

/**
* Attributes of an imported VpnConnection.
*/
export interface VpnConnectionAttributes {

/**
* The id of the VPN connection.
*/
readonly vpnId: string;

/**
* The id of the customer gateway.
*/
readonly customerGatewayId: string;

/**
* The ip address of the customer gateway.
*/
readonly customerGatewayIp: string;

/**
* The ASN of the customer gateway.
*/
readonly customerGatewayAsn: number;

}

/**
* Base class for Vpn connections.
*/
export abstract class VpnConnectionBase extends Resource implements IVpnConnection {

public abstract readonly vpnId: string;
public abstract readonly customerGatewayId: string;
public abstract readonly customerGatewayIp: string;
public abstract readonly customerGatewayAsn: number;

}

/**
* Define a VPN Connection
*
* @resource AWS::EC2::VPNConnection
*/
export class VpnConnection extends Resource implements IVpnConnection {
export class VpnConnection extends VpnConnectionBase {

/**
* Import a VPN connection by supplying all attributes directly
*/
public static fromVpnConnectionAttributes(scope: Construct, id: string, attrs: VpnConnectionAttributes): IVpnConnection {

class Import extends VpnConnectionBase {

public readonly vpnId: string = attrs.vpnId;
public readonly customerGatewayId: string = attrs.customerGatewayId;
public readonly customerGatewayIp: string = attrs.customerGatewayIp;
public readonly customerGatewayAsn: number = attrs.customerGatewayAsn;

}

return new Import(scope, id);

}

/**
* Return the given named metric for all VPN connections in the account/region.
*/
Expand Down
42 changes: 42 additions & 0 deletions packages/@aws-cdk/aws-ec2/test/vpn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,48 @@ describe('vpn', () => {

});

test('can import a vpn connection from attributes', () => {

const stack = new Stack();

const vpn = VpnConnection.fromVpnConnectionAttributes(stack, 'Connection', {
vpnId: 'idv',
customerGatewayIp: 'ip',
customerGatewayId: 'idc',
customerGatewayAsn: 6500,
});

expect(vpn.vpnId).toEqual('idv');
expect(vpn.customerGatewayAsn).toEqual(6500);
expect(vpn.customerGatewayId).toEqual('idc');
expect(vpn.customerGatewayIp).toEqual('ip');

expect(stack.resolve(vpn.metricTunnelState())).toEqual({
dimensions: { VpnId: 'idv' },
namespace: 'AWS/VPN',
metricName: 'TunnelState',
period: Duration.minutes(5),
statistic: 'Average',
});

expect(stack.resolve(vpn.metricTunnelDataIn())).toEqual({
dimensions: { VpnId: 'idv' },
namespace: 'AWS/VPN',
metricName: 'TunnelDataIn',
period: Duration.minutes(5),
statistic: 'Sum',
});

expect(stack.resolve(vpn.metricTunnelDataOut())).toEqual({
dimensions: { VpnId: 'idv' },
namespace: 'AWS/VPN',
metricName: 'TunnelDataOut',
period: Duration.minutes(5),
statistic: 'Sum',
});

});

test('can use metricAllTunnelDataOut', () => {
// GIVEN
const stack = new Stack();
Expand Down
58 changes: 58 additions & 0 deletions packages/@aws-cdk/cfnspec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# CloudFormation Resource Specification v89.0.0

## New Resource Types


## Attribute Changes

* AWS::EC2::VPNConnection Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html
* AWS::EC2::VPNConnection VpnConnectionId (__added__)

## Property Changes

* AWS::EC2::VPNConnection CustomerGatewayId.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-customergatewayid
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-customergatewayid
* AWS::EC2::VPNConnection StaticRoutesOnly.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-StaticRoutesOnly
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-staticroutesonly
* AWS::EC2::VPNConnection Tags.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-tags
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-tags
* AWS::EC2::VPNConnection TransitGatewayId.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-transitgatewayid
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-transitgatewayid
* AWS::EC2::VPNConnection Type.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-type
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-type
* AWS::EC2::VPNConnection VpnGatewayId.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-vpngatewayid
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-vpngatewayid
* AWS::EC2::VPNConnection VpnTunnelOptionsSpecifications.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpn-connection.html#cfn-ec2-vpnconnection-vpntunneloptionsspecifications
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpnconnection.html#cfn-ec2-vpnconnection-vpntunneloptionsspecifications
* AWS::EC2::VPNConnection VpnTunnelOptionsSpecifications.DuplicatesAllowed (__changed__)
* Old: false
* New: true
* AWS::Evidently::Project AppConfigResource (__added__)
* AWS::IoT::CACertificate RemoveAutoRegistration (__added__)
* AWS::Logs::Destination DestinationPolicy.Required (__changed__)
* Old: true
* New: false
* AWS::RDS::DBInstance CustomIAMInstanceProfile (__added__)
* AWS::RDS::DBInstance NcharCharacterSetName (__added__)
* AWS::Redshift::ClusterParameterGroup Parameters.DuplicatesAllowed (__deleted__)
* AWS::Redshift::ClusterParameterGroup Tags.DuplicatesAllowed (__deleted__)

## Property Type Changes

* AWS::Evidently::Project.AppConfigResourceObject (__added__)
* AWS::MediaPackage::OriginEndpoint.CmafEncryption EncryptionMethod (__added__)

## Unapplied changes

* AWS::Rekognition is at 68.0.0
* AWS::SageMaker is at 72.0.0

# CloudFormation Resource Specification v88.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 @@
88.0.0
89.0.0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"options": {
"classFile": "vpn",
"class": "VpnConnection",
"class": "VpnConnectionBase",
"interface": "IVpnConnection"
},
"metrics": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::ACMPCA::Certificate.ApiPassthrough": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-acmpca-certificate-apipassthrough.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::APS::Workspace.LoggingConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-workspace-loggingconfiguration.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AccessAnalyzer::Analyzer.ArchiveRule": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-archiverule.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AmazonMQ::Broker.ConfigurationId": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amazonmq-broker-configurationid.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::Amplify::App.AutoBranchCreationConfig": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AmplifyUIBuilder::Component.ActionParameters": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplifyuibuilder-component-actionparameters.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::ApiGateway::ApiKey.StageKey": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-apikey-stagekey.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::ApiGatewayV2::Api.BodyS3Location": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-api-bodys3location.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppConfig::Application.Tags": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appconfig-application-tags.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppFlow::ConnectorProfile.AmplitudeConnectorProfileCredentials": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appflow-connectorprofile-amplitudeconnectorprofilecredentials.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppIntegrations::DataIntegration.ScheduleConfig": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appintegrations-dataintegration-scheduleconfig.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppMesh::GatewayRoute.GatewayRouteHostnameMatch": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-gatewayroute-gatewayroutehostnamematch.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppRunner::ObservabilityConfiguration.TraceConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-observabilityconfiguration-traceconfiguration.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppStream::AppBlock.S3Location": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appstream-appblock-s3location.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AppSync::DataSource.AuthorizationConfig": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-datasource-authorizationconfig.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::ApplicationAutoScaling::ScalableTarget.ScalableTargetAction": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationautoscaling-scalabletarget-scalabletargetaction.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::ApplicationInsights::Application.Alarm": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationinsights-application-alarm.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::Athena::WorkGroup.EncryptionConfiguration": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-encryptionconfiguration.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AuditManager::Assessment.AWSAccount": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-auditmanager-assessment-awsaccount.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AutoScaling::AutoScalingGroup.AcceleratorCountRequest": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::AutoScalingPlans::ScalingPlan.ApplicationSource": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-applicationsource.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::Backup::BackupPlan.AdvancedBackupSettingResourceType": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-backup-backupplan-advancedbackupsettingresourcetype.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::Batch::ComputeEnvironment.ComputeResources": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-computeenvironment-computeresources.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::BillingConductor::BillingGroup.AccountGrouping": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-billingconductor-billinggroup-accountgrouping.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "88.0.0",
"$version": "89.0.0",
"PropertyTypes": {
"AWS::Budgets::Budget.BudgetData": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-budgets-budget-budgetdata.html",
Expand Down
Loading

0 comments on commit da9caaf

Please sign in to comment.