Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into externalModules-for…
Browse files Browse the repository at this point in the history
…-sdkV3
  • Loading branch information
mrgrain committed Nov 25, 2022
2 parents c9135e8 + e53352d commit 77cf98d
Show file tree
Hide file tree
Showing 248 changed files with 5,204 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v6
- uses: aws-actions/stale-issue-cleanup@v5
with:
# Setting messages to an empty string will cause the automation to skip
# that category
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export function matcherFrom(matcher: any): PropertyMatcher {
* would show (in traditional JS fashion) something like '[function Function]', or more
* accurately nothing at all since functions cannot be JSONified.
*
* We override to JSON() in order to produce a readadable version of the matcher.
* We override to JSON() in order to produce a readable version of the matcher.
*/
export function annotateMatcher<A extends object>(how: A, matcher: PropertyMatcher): PropertyMatcher {
(matcher as any).toJSON = () => how;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assertions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ Here are the available APIs for `Annotations`:
The corresponding `findXxx()` API is complementary to the `hasXxx()` API, except instead
of asserting its presence, it returns the set of matching messages.

In addition, this suite of APIs is compatable with `Matchers` for more fine-grained control.
In addition, this suite of APIs is compatible with `Matchers` for more fine-grained control.
For example, the following assertion works as well:

```ts
Expand Down
7 changes: 4 additions & 3 deletions packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ A usage plan specifies who can access one or more deployed API stages and method
accessed. The plan uses API keys to identify API clients and meters access to the associated API stages for each key.
Usage plans also allow configuring throttling limits and quota limits that are enforced on individual client API keys.

The following example shows how to create and asscociate a usage plan and an API key:
The following example shows how to create and associate a usage plan and an API key:

```ts
declare const integration: apigateway.LambdaIntegration;
Expand Down Expand Up @@ -1378,8 +1378,9 @@ api.addGatewayResponse('test-response', {
type: apigateway.ResponseType.ACCESS_DENIED,
statusCode: '500',
responseHeaders: {
'Access-Control-Allow-Origin': 'test.com',
'test-key': 'test-value',
// Note that values must be enclosed within a pair of single quotes
'Access-Control-Allow-Origin': "'test.com'",
'test-key': "'test-value'",
},
templates: {
'application/json': '{ "message": $context.error.messageString, "statusCode": "488", "type": "$context.error.responseType" }'
Expand Down
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { IResource, Resource } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnGatewayResponse, CfnGatewayResponseProps } from './apigateway.generated';
import { IRestApi } from './restapi';
import { normalizeResponseParameterValue } from './util';

/**
* Represents gateway response resource.
Expand Down Expand Up @@ -89,7 +88,7 @@ export class GatewayResponse extends Resource implements IGatewayResponse {

const responseParameters: { [key: string]: string } = {};
for (const [header, value] of Object.entries(responseHeaders)) {
responseParameters[`gatewayresponse.header.${header}`] = normalizeResponseParameterValue(value) ;
responseParameters[`gatewayresponse.header.${header}`] = value;
}
return responseParameters;
}
Expand Down
16 changes: 0 additions & 16 deletions packages/@aws-cdk/aws-apigateway/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ export function validateHttpMethod(method: string, messagePrefix: string = '') {
}
}

/**
* Response header values need to be enclosed in single quotes.
*/
export function normalizeResponseParameterValue(value: string) {
if (!value) {
return value;
}

// check if the value is already enclosed in single quotes
if (value.startsWith("'") && value.endsWith("'")) {
return value;
}

return `'${value}'`;
}

export function parseMethodOptionsPath(originalPath: string): { resourcePath: string, httpMethod: string } {
if (!originalPath.startsWith('/')) {
throw new Error(`Method options path must start with '/': ${originalPath}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe('gateway response', () => {
responseHeaders: {
'Access-Control-Allow-Origin': 'test.com',
'test-key': 'test-value',
'another-test': "'test-value-enclosed-within-single-quotes'",
},
});

Expand All @@ -55,9 +54,8 @@ describe('gateway response', () => {
RestApiId: stack.resolve(api.restApiId),
StatusCode: '500',
ResponseParameters: {
'gatewayresponse.header.Access-Control-Allow-Origin': "'test.com'",
'gatewayresponse.header.test-key': "'test-value'",
'gatewayresponse.header.another-test': "'test-value-enclosed-within-single-quotes'",
'gatewayresponse.header.Access-Control-Allow-Origin': 'test.com',
'gatewayresponse.header.test-key': 'test-value',
},
ResponseTemplates: Match.absent(),
});
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-appmesh/lib/virtual-node-listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface CommonHttpVirtualNodeListenerOptions extends VirtualNodeListenerCommon
}

/**
* Represent the HTTP Node Listener prorperty
* Represent the HTTP Node Listener property
*/
export interface HttpVirtualNodeListenerOptions extends CommonHttpVirtualNodeListenerOptions {

Expand All @@ -74,7 +74,7 @@ export interface HttpVirtualNodeListenerOptions extends CommonHttpVirtualNodeLis
}

/**
* Represent the HTTP2 Node Listener prorperty
* Represent the HTTP2 Node Listener property
*/
export interface Http2VirtualNodeListenerOptions extends CommonHttpVirtualNodeListenerOptions {
/**
Expand All @@ -86,7 +86,7 @@ export interface Http2VirtualNodeListenerOptions extends CommonHttpVirtualNodeLi
}

/**
* Represent the GRPC Node Listener prorperty
* Represent the GRPC Node Listener property
*/
export interface GrpcVirtualNodeListenerOptions extends VirtualNodeListenerCommonOptions {
/**
Expand All @@ -105,7 +105,7 @@ export interface GrpcVirtualNodeListenerOptions extends VirtualNodeListenerCommo
}

/**
* Represent the TCP Node Listener prorperty
* Represent the TCP Node Listener property
*/
export interface TcpVirtualNodeListenerOptions extends VirtualNodeListenerCommonOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appsync/lib/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export abstract class BaseDataSource extends Construct {
super(scope, id);

if (extended.type !== 'NONE') {
this.serviceRole = props.serviceRole || new Role(this, 'ServiceRole', { assumedBy: new ServicePrincipal('appsync') });
this.serviceRole = props.serviceRole || new Role(this, 'ServiceRole', { assumedBy: new ServicePrincipal('appsync.amazonaws.com') });
}
// Replace unsupported characters from DataSource name. The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}
const name = (props.name ?? id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "21.0.0",
"files": {
"8af15bf3b17fb15e9d1b558caa4d5484d9b85fd19d3d939c866e805212d8d66a": {
"b0462850439179659920597f4327262b24073af4f4969622163b0a295fce1dda": {
"source": {
"path": "aws-appsync-integ.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "8af15bf3b17fb15e9d1b558caa4d5484d9b85fd19d3d939c866e805212d8d66a.json",
"objectKey": "b0462850439179659920597f4327262b24073af4f4969622163b0a295fce1dda.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8af15bf3b17fb15e9d1b558caa4d5484d9b85fd19d3d939c866e805212d8d66a.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/b0462850439179659920597f4327262b24073af4f4969622163b0a295fce1dda.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
"id": "ServiceRole",
"path": "aws-appsync-integ/Api/testDataSource/ServiceRole",
"children": {
"ImportServiceRole": {
"id": "ImportServiceRole",
"path": "aws-appsync-integ/Api/testDataSource/ServiceRole/ImportServiceRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "aws-appsync-integ/Api/testDataSource/ServiceRole/Resource",
Expand All @@ -94,7 +102,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -363,7 +371,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.140"
"version": "10.1.161"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "21.0.0",
"files": {
"677bc89625ae9e4bce11a3674b3575c54aa714db0cc253c6121311ab6a929305": {
"08fe8252ae99e2f46d03e04321cb848d70ee9c2656baeb387f3baae1575b1d87": {
"source": {
"path": "appsync-elasticsearch.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "677bc89625ae9e4bce11a3674b3575c54aa714db0cc253c6121311ab6a929305.json",
"objectKey": "08fe8252ae99e2f46d03e04321cb848d70ee9c2656baeb387f3baae1575b1d87.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/677bc89625ae9e4bce11a3674b3575c54aa714db0cc253c6121311ab6a929305.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/08fe8252ae99e2f46d03e04321cb848d70ee9c2656baeb387f3baae1575b1d87.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@
"id": "ServiceRole",
"path": "appsync-elasticsearch/api/ds/ServiceRole",
"children": {
"ImportServiceRole": {
"id": "ImportServiceRole",
"path": "appsync-elasticsearch/api/ds/ServiceRole/ImportServiceRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "appsync-elasticsearch/api/ds/ServiceRole/Resource",
Expand All @@ -177,7 +185,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -383,7 +391,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.140"
"version": "10.1.161"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"5adac1311d44e3f6eafd25a229c84d03d0e6281172ec45c266b80a5201176917": {
"8d15941ec2e2ee7e1551ec111288fbf5f90d3c8054ccd83a9d3f4995d2475536": {
"source": {
"path": "aws-appsync-integ.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "5adac1311d44e3f6eafd25a229c84d03d0e6281172ec45c266b80a5201176917.json",
"objectKey": "8d15941ec2e2ee7e1551ec111288fbf5f90d3c8054ccd83a9d3f4995d2475536.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5adac1311d44e3f6eafd25a229c84d03d0e6281172ec45c266b80a5201176917.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8d15941ec2e2ee7e1551ec111288fbf5f90d3c8054ccd83a9d3f4995d2475536.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@
"id": "ServiceRole",
"path": "aws-appsync-integ/Api/ds/ServiceRole",
"children": {
"ImportServiceRole": {
"id": "ImportServiceRole",
"path": "aws-appsync-integ/Api/ds/ServiceRole/ImportServiceRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "aws-appsync-integ/Api/ds/ServiceRole/Resource",
Expand All @@ -137,7 +145,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "appsync"
"Service": "appsync.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -418,6 +426,14 @@
"id": "LambdaIAM",
"path": "aws-appsync-integ/LambdaIAM",
"children": {
"ImportLambdaIAM": {
"id": "ImportLambdaIAM",
"path": "aws-appsync-integ/LambdaIAM/ImportLambdaIAM",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "aws-appsync-integ/LambdaIAM/Resource",
Expand Down Expand Up @@ -655,6 +671,14 @@
"id": "ServiceRole",
"path": "aws-appsync-integ/testFail/ServiceRole",
"children": {
"ImportServiceRole": {
"id": "ImportServiceRole",
"path": "aws-appsync-integ/testFail/ServiceRole/ImportServiceRole",
"constructInfo": {
"fqn": "@aws-cdk/core.Resource",
"version": "0.0.0"
}
},
"Resource": {
"id": "Resource",
"path": "aws-appsync-integ/testFail/ServiceRole/Resource",
Expand Down Expand Up @@ -796,7 +820,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.140"
"version": "10.1.161"
}
}
},
Expand Down
Loading

0 comments on commit 77cf98d

Please sign in to comment.