Skip to content

Commit

Permalink
Merge branch 'main' into feat/partition_literal
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 12, 2022
2 parents 56cc0df + f135b80 commit 0f82798
Show file tree
Hide file tree
Showing 56 changed files with 1,579 additions and 1,176 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

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.

## [2.37.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.37.0-alpha.0...v2.37.1-alpha.0) (2022-08-10)

## [2.37.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.36.0-alpha.0...v2.37.0-alpha.0) (2022-08-09)


Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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.

## [2.37.1](https://github.com/aws/aws-cdk/compare/v2.37.0...v2.37.1) (2022-08-10)

### Bug Fixes

* **eks:** revert "fix(eks): cannot disable cluster logging once it has been enabled" ([#21545](https://github.com/aws/aws-cdk/pull/21545)) ([5515ce4](https://github.com/aws/aws-cdk/commit/5515ce4b439d7917bbba662d852acc29fea9d8a4))

## [2.37.0](https://github.com/aws/aws-cdk/compare/v2.36.0...v2.37.0) (2022-08-09)


Expand Down
2 changes: 1 addition & 1 deletion MANUAL_INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ its signature against our public signing key. To do so, you need
the following things:

* [GNU Privacy Guard](https://gnupg.org/) needs to be installed.
* Download our public key: https://s3.amazonaws.com/aws-cdk-beta/cdk-team.asc
* Download our public key: https://docs.aws.amazon.com/cdk/v2/guide/pgp-keys.html
* Make sure you have downloaded both `aws-cdk-x.y.z.zip`
and `aws-cdk-x.y.z.zip.sig`.

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ const zone = route53.HostedZone.fromHostedZoneAttributes(this, `HostedZone`, {
new route53.CnameRecord(this, `CnameApiRecord`, {
recordName: 'api',
zone,
domainName: myDomainName,
domainName: api.appSyncDomainName,
});
```

Expand Down
17 changes: 14 additions & 3 deletions packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ export class GraphqlApi extends GraphqlApiBase {
private schemaResource: CfnGraphQLSchema;
private api: CfnGraphQLApi;
private apiKeyResource?: CfnApiKey;
private domainNameResource?: CfnDomainName;

constructor(scope: Construct, id: string, props: GraphqlApiProps) {
super(scope, id);
Expand Down Expand Up @@ -510,18 +511,17 @@ export class GraphqlApi extends GraphqlApiBase {
this.schemaResource = this.schema.bind(this);

if (props.domainName) {
const domainName = new CfnDomainName(this, 'DomainName', {
this.domainNameResource = new CfnDomainName(this, 'DomainName', {
domainName: props.domainName.domainName,
certificateArn: props.domainName.certificate.certificateArn,
description: `domain for ${this.name} at ${this.graphqlUrl}`,
});

const domainNameAssociation = new CfnDomainNameApiAssociation(this, 'DomainAssociation', {
domainName: props.domainName.domainName,
apiId: this.apiId,
});

domainNameAssociation.addDependsOn(domainName);
domainNameAssociation.addDependsOn(this.domainNameResource);
}

if (modes.some((mode) => mode.authorizationType === AuthorizationType.API_KEY)) {
Expand Down Expand Up @@ -774,4 +774,15 @@ export class GraphqlApi extends GraphqlApiBase {
public addSubscription(fieldName: string, field: ResolvableField): ObjectType {
return this.schema.addSubscription(fieldName, field);
}


/**
* The AppSyncDomainName of the associated custom domain
*/
public get appSyncDomainName(): string {
if (!this.domainNameResource) {
throw new Error('Cannot retrieve the appSyncDomainName without a domainName configuration');
}
return this.domainNameResource.attrAppSyncDomainName;
}
}
26 changes: 26 additions & 0 deletions packages/@aws-cdk/aws-appsync/test/appsync-domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,30 @@ describe('Tests of AppSync Domain Name', () => {
},
);
});

test('appSyncDomainName exposes the domain of the associated AWS::AppSync::DomainName', () => {
const api = new appsync.GraphqlApi(stack, 'baseApi', {
name: 'api',
schema: appsync.Schema.fromAsset(
path.join(__dirname, 'appsync.test.graphql'),
),
domainName: {
certificate,
domainName: 'aws.amazon.com',
},
});

expect(stack.resolve(api.appSyncDomainName)).toEqual({ 'Fn::GetAtt': ['baseApiDomainName52E3D63D', 'AppSyncDomainName'] });
});

test('appSyncDomainName should throw an error when no custom domain has been configured', () => {
const api = new appsync.GraphqlApi(stack, 'baseApi', {
name: 'api',
schema: appsync.Schema.fromAsset(
path.join(__dirname, 'appsync.test.graphql'),
),
});

expect(() => api.appSyncDomainName).toThrow('Cannot retrieve the appSyncDomainName without a domainName configuration');
});
});

This file was deleted.

Loading

0 comments on commit 0f82798

Please sign in to comment.