-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(aws-apprunner): fix integration tests (#19660)
splitting up the integration tests into separate tests so that we can separate the ones that can be run and those that can't. The github test requires a connection to github so it can't be run in automation. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
7 changed files
with
227 additions
and
201 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
packages/@aws-cdk/aws-apprunner/test/integ.service-ecr-public.expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"Resources": { | ||
"Service1EDCC8134": { | ||
"Type": "AWS::AppRunner::Service", | ||
"Properties": { | ||
"SourceConfiguration": { | ||
"AuthenticationConfiguration": {}, | ||
"ImageRepository": { | ||
"ImageConfiguration": { | ||
"Port": "8000" | ||
}, | ||
"ImageIdentifier": "public.ecr.aws/aws-containers/hello-app-runner:latest", | ||
"ImageRepositoryType": "ECR_PUBLIC" | ||
} | ||
}, | ||
"InstanceConfiguration": {} | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"URL1": { | ||
"Value": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"https://", | ||
{ | ||
"Fn::GetAtt": [ | ||
"Service1EDCC8134", | ||
"ServiceUrl" | ||
] | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/@aws-cdk/aws-apprunner/test/integ.service-ecr-public.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as cdk from '@aws-cdk/core'; | ||
import { Service, Source } from '../lib'; | ||
|
||
|
||
const app = new cdk.App(); | ||
|
||
const stack = new cdk.Stack(app, 'integ-apprunner-ecr-public'); | ||
|
||
// Scenario 1: Create the service from ECR public | ||
const service1 = new Service(stack, 'Service1', { | ||
source: Source.fromEcrPublic({ | ||
imageConfiguration: { | ||
port: 8000, | ||
}, | ||
imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest', | ||
}), | ||
}); | ||
new cdk.CfnOutput(stack, 'URL1', { value: `https://${service1.serviceUrl}` }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as path from 'path'; | ||
import * as assets from '@aws-cdk/aws-ecr-assets'; | ||
import * as cdk from '@aws-cdk/core'; | ||
import { Service, Source } from '../lib'; | ||
|
||
|
||
const app = new cdk.App(); | ||
|
||
const stack = new cdk.Stack(app, 'integ-apprunner'); | ||
|
||
|
||
// Scenario 3: Create the service from local code assets | ||
const imageAsset = new assets.DockerImageAsset(stack, 'ImageAssets', { | ||
directory: path.join(__dirname, './docker.assets'), | ||
}); | ||
const service3 = new Service(stack, 'Service3', { | ||
source: Source.fromAsset({ | ||
imageConfiguration: { port: 8000 }, | ||
asset: imageAsset, | ||
}), | ||
}); | ||
new cdk.CfnOutput(stack, 'URL3', { value: `https://${service3.serviceUrl}` }); | ||
|
||
// Scenario 2: Create the service from existing ECR repository | ||
const service2 = new Service(stack, 'Service2', { | ||
source: Source.fromEcr({ | ||
imageConfiguration: { port: 80 }, | ||
repository: imageAsset.repository, | ||
tag: imageAsset.assetHash, | ||
}), | ||
}); | ||
new cdk.CfnOutput(stack, 'URL2', { value: `https://${service2.serviceUrl}` }); |
Oops, something went wrong.