Skip to content

Commit

Permalink
Merge branch 'master' into issue_10969
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 23, 2021
2 parents 1907f1c + 520c263 commit 41f7ac6
Show file tree
Hide file tree
Showing 160 changed files with 3,661 additions and 900 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Restore Yarn cache
uses: actions/cache@v2
uses: actions/cache@v2.1.4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@
"Type": "AWS::SQS::Queue",
"Properties": {
"MessageRetentionPeriod": 1209600
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"nameserviceTaskRecordManagerEventsQueueF805A6C1": {
"Type": "AWS::SQS::Queue",
Expand All @@ -415,7 +417,9 @@
"maxReceiveCount": 500
},
"VisibilityTimeout": 30
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"nameserviceTaskRecordManagerEventsQueuePolicy65CC6F9E": {
"Type": "AWS::SQS::QueuePolicy",
Expand Down Expand Up @@ -746,14 +750,12 @@
]
}
},
"Handler": "index.queue_handler",
"Role": {
"Fn::GetAtt": [
"nameserviceTaskRecordManagerEventHandlerServiceRoleE66EE52A",
"Arn"
]
},
"Runtime": "python3.8",
"Environment": {
"Variables": {
"HOSTED_ZONE_ID": {
Expand All @@ -777,7 +779,9 @@
}
}
},
"Handler": "index.queue_handler",
"ReservedConcurrentExecutions": 1,
"Runtime": "python3.8",
"Timeout": 30
},
"DependsOn": [
Expand All @@ -788,14 +792,14 @@
"nameserviceTaskRecordManagerEventHandlerSqsEventSourceawsecsintegnameserviceTaskRecordManagerEventsQueueC5EE9A869F1EB155": {
"Type": "AWS::Lambda::EventSourceMapping",
"Properties": {
"FunctionName": {
"Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905"
},
"EventSourceArn": {
"Fn::GetAtt": [
"nameserviceTaskRecordManagerEventsQueueF805A6C1",
"Arn"
]
},
"FunctionName": {
"Ref": "nameserviceTaskRecordManagerEventHandler4B8C6905"
}
}
},
Expand Down Expand Up @@ -909,13 +913,13 @@
]
}
},
"Handler": "index.cleanup_resource_handler",
"Role": {
"Fn::GetAtt": [
"nameserviceTaskRecordManagerCleanupResourceProviderHandlerServiceRoleCCA462F0",
"Arn"
]
},
"Handler": "index.cleanup_resource_handler",
"Runtime": "python3.8",
"Timeout": 300
},
Expand Down Expand Up @@ -1022,14 +1026,12 @@
]
}
},
"Handler": "framework.onEvent",
"Role": {
"Fn::GetAtt": [
"nameserviceTaskRecordManagerCleanupResourceProviderframeworkonEventServiceRoleF0570BD0",
"Arn"
]
},
"Runtime": "nodejs10.x",
"Description": "AWS CDK resource provider framework - onEvent (aws-ecs-integ/name-service/TaskRecordManager/CleanupResourceProvider)",
"Environment": {
"Variables": {
Expand All @@ -1041,6 +1043,8 @@
}
}
},
"Handler": "framework.onEvent",
"Runtime": "nodejs10.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -1242,13 +1246,13 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleC1EA0FF2",
"Arn"
]
},
"Handler": "index.handler",
"Runtime": "nodejs12.x",
"Timeout": 120
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
]
]
}
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"ServiceloadbalancerD5D60894": {
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"EmailSubject": "Verify your new account",
"SmsMessage": "The verification code to your new account is {####}"
}
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"myauthorizer23CB99DD": {
"Type": "AWS::ApiGateway::Authorizer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@
"Ref": "RestApi0C43BF4B"
}
}
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"integrestapiimportBooksStackNestedStackintegrestapiimportBooksStackNestedStackResource395C2C9B": {
"Type": "AWS::CloudFormation::Stack",
Expand Down Expand Up @@ -192,7 +194,9 @@
"Ref": "RestApi0C43BF4B"
}
}
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"integrestapiimportDeployStackNestedStackintegrestapiimportDeployStackNestedStackResource0D0EE737": {
"Type": "AWS::CloudFormation::Stack",
Expand Down Expand Up @@ -252,7 +256,9 @@
"DependsOn": [
"integrestapiimportBooksStackNestedStackintegrestapiimportBooksStackNestedStackResource395C2C9B",
"integrestapiimportPetsStackNestedStackintegrestapiimportPetsStackNestedStackResource2B31898B"
]
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
"EmailSubject": "Verify your new account",
"SmsMessage": "The verification code to your new account is {####}"
}
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"userpoolmyclientFAD947AB": {
"Type": "AWS::Cognito::UserPoolClient",
Expand Down
10 changes: 7 additions & 3 deletions packages/@aws-cdk/aws-appsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ const secret = new rds.DatabaseSecret(stack, 'AuroraSecret', {
username: 'clusteradmin',
});

// Create the DB cluster, provide all values needed to customise the database.
const cluster = new rds.DatabaseCluster(stack, 'AuroraCluster', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_07_1 }),
// The VPC to place the cluster in
const vpc = new ec2.Vpc(stack, 'AuroraVpc');

// Create the serverless cluster, provide all values needed to customise the database.
const cluster = new rds.ServerlessCluster(stack, 'AuroraCluster', {
engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
vpc,
credentials: { username: 'clusteradmin' },
clusterIdentifier: 'db-endpoint-test',
defaultDatabaseName: 'demos',
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-appsync/lib/data-source.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ITable } from '@aws-cdk/aws-dynamodb';
import { Grant, IGrantable, IPrincipal, IRole, Role, ServicePrincipal } from '@aws-cdk/aws-iam';
import { IFunction } from '@aws-cdk/aws-lambda';
import { IDatabaseCluster } from '@aws-cdk/aws-rds';
import { IServerlessCluster } from '@aws-cdk/aws-rds';
import { ISecret } from '@aws-cdk/aws-secretsmanager';
import { IResolvable, Lazy, Stack } from '@aws-cdk/core';
import { Construct } from 'constructs';
Expand Down Expand Up @@ -303,9 +303,9 @@ export class LambdaDataSource extends BackedDataSource {
*/
export interface RdsDataSourceProps extends BackedDataSourceProps {
/**
* The database cluster to call to interact with this data source
* The serverless cluster to call to interact with this data source
*/
readonly databaseCluster: IDatabaseCluster;
readonly serverlessCluster: IServerlessCluster;
/**
* The secret containing the credentials for the database
*/
Expand All @@ -327,12 +327,12 @@ export class RdsDataSource extends BackedDataSource {
type: 'RELATIONAL_DATABASE',
relationalDatabaseConfig: {
rdsHttpEndpointConfig: {
awsRegion: props.databaseCluster.stack.region,
awsRegion: props.serverlessCluster.stack.region,
dbClusterIdentifier: Lazy.string({
produce: () => {
return Stack.of(this).formatArn({
service: 'rds',
resource: `cluster:${props.databaseCluster.clusterIdentifier}`,
resource: `cluster:${props.serverlessCluster.clusterIdentifier}`,
});
},
}),
Expand All @@ -344,7 +344,7 @@ export class RdsDataSource extends BackedDataSource {
});
const clusterArn = Stack.of(this).formatArn({
service: 'rds',
resource: `cluster:${props.databaseCluster.clusterIdentifier}`,
resource: `cluster:${props.serverlessCluster.clusterIdentifier}`,
});
props.secretStore.grantRead(this);

Expand Down
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-appsync/lib/graphqlapi-base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ITable } from '@aws-cdk/aws-dynamodb';
import { IFunction } from '@aws-cdk/aws-lambda';
import { IDatabaseCluster } from '@aws-cdk/aws-rds';
import { IServerlessCluster } from '@aws-cdk/aws-rds';
import { ISecret } from '@aws-cdk/aws-secretsmanager';
import { CfnResource, IResource, Resource } from '@aws-cdk/core';
import { DynamoDbDataSource, HttpDataSource, LambdaDataSource, NoneDataSource, RdsDataSource, AwsIamConfig } from './data-source';
Expand Down Expand Up @@ -97,14 +97,14 @@ export interface IGraphqlApi extends IResource {
* add a new Rds data source to this API
*
* @param id The data source's id
* @param databaseCluster The database cluster to interact with this data source
* @param secretStore The secret store that contains the username and password for the database cluster
* @param serverlessCluster The serverless cluster to interact with this data source
* @param secretStore The secret store that contains the username and password for the serverless cluster
* @param databaseName The optional name of the database to use within the cluster
* @param options The optional configuration for this data source
*/
addRdsDataSource(
id: string,
databaseCluster: IDatabaseCluster,
serverlessCluster: IServerlessCluster,
secretStore: ISecret,
databaseName?: string,
options?: DataSourceOptions
Expand Down Expand Up @@ -206,14 +206,14 @@ export abstract class GraphqlApiBase extends Resource implements IGraphqlApi {
/**
* add a new Rds data source to this API
* @param id The data source's id
* @param databaseCluster The database cluster to interact with this data source
* @param secretStore The secret store that contains the username and password for the database cluster
* @param serverlessCluster The serverless cluster to interact with this data source
* @param secretStore The secret store that contains the username and password for the serverless cluster
* @param databaseName The optional name of the database to use within the cluster
* @param options The optional configuration for this data source
*/
public addRdsDataSource(
id: string,
databaseCluster: IDatabaseCluster,
serverlessCluster: IServerlessCluster,
secretStore: ISecret,
databaseName?: string,
options?: DataSourceOptions,
Expand All @@ -222,7 +222,7 @@ export abstract class GraphqlApiBase extends Resource implements IGraphqlApi {
api: this,
name: options?.name,
description: options?.description,
databaseCluster,
serverlessCluster,
secretStore,
databaseName,
});
Expand Down
30 changes: 12 additions & 18 deletions packages/@aws-cdk/aws-appsync/test/appsync-rds.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@aws-cdk/assert/jest';
import * as path from 'path';
import { Vpc, SecurityGroup, SubnetType, InstanceType, InstanceClass, InstanceSize } from '@aws-cdk/aws-ec2';
import { DatabaseSecret, DatabaseCluster, DatabaseClusterEngine, AuroraMysqlEngineVersion } from '@aws-cdk/aws-rds';
import { Vpc, SecurityGroup, SubnetType } from '@aws-cdk/aws-ec2';
import { DatabaseSecret, DatabaseClusterEngine, AuroraMysqlEngineVersion, ServerlessCluster } from '@aws-cdk/aws-rds';
import * as cdk from '@aws-cdk/core';
import * as appsync from '../lib';

Expand All @@ -21,7 +21,7 @@ beforeEach(() => {
describe('Rds Data Source configuration', () => {
// GIVEN
let secret: DatabaseSecret;
let cluster: DatabaseCluster;
let cluster: ServerlessCluster;
beforeEach(() => {
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 });
const securityGroup = new SecurityGroup(stack, 'AuroraSecurityGroup', {
Expand All @@ -31,16 +31,13 @@ describe('Rds Data Source configuration', () => {
secret = new DatabaseSecret(stack, 'AuroraSecret', {
username: 'clusteradmin',
});
cluster = new DatabaseCluster(stack, 'AuroraCluster', {
cluster = new ServerlessCluster(stack, 'AuroraCluster', {
engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_2_07_1 }),
credentials: { username: 'clusteradmin' },
clusterIdentifier: 'db-endpoint-test',
instanceProps: {
instanceType: InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.SMALL),
vpcSubnets: { subnetType: SubnetType.PRIVATE },
vpc,
securityGroups: [securityGroup],
},
vpc,
vpcSubnets: { subnetType: SubnetType.PRIVATE },
securityGroups: [securityGroup],
defaultDatabaseName: 'Animals',
});
});
Expand Down Expand Up @@ -205,7 +202,7 @@ describe('Rds Data Source configuration', () => {
describe('adding rds data source from imported api', () => {
// GIVEN
let secret: DatabaseSecret;
let cluster: DatabaseCluster;
let cluster: ServerlessCluster;
beforeEach(() => {
const vpc = new Vpc(stack, 'Vpc', { maxAzs: 2 });
const securityGroup = new SecurityGroup(stack, 'AuroraSecurityGroup', {
Expand All @@ -215,16 +212,13 @@ describe('adding rds data source from imported api', () => {
secret = new DatabaseSecret(stack, 'AuroraSecret', {
username: 'clusteradmin',
});
cluster = new DatabaseCluster(stack, 'AuroraCluster', {
cluster = new ServerlessCluster(stack, 'AuroraCluster', {
engine: DatabaseClusterEngine.auroraMysql({ version: AuroraMysqlEngineVersion.VER_2_07_1 }),
credentials: { username: 'clusteradmin' },
clusterIdentifier: 'db-endpoint-test',
instanceProps: {
instanceType: InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.SMALL),
vpcSubnets: { subnetType: SubnetType.PRIVATE },
vpc,
securityGroups: [securityGroup],
},
vpc,
vpcSubnets: { subnetType: SubnetType.PRIVATE },
securityGroups: [securityGroup],
defaultDatabaseName: 'Animals',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"EmailSubject": "Verify your new account",
"SmsMessage": "The verification code to your new account is {####}"
}
}
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"ApiF70053CD": {
"Type": "AWS::AppSync::GraphQLApi",
Expand Down
Loading

0 comments on commit 41f7ac6

Please sign in to comment.