18 |
{{ name }}
19 |
Congratulations
20 |
Your Flask application is now running on a container in {{ platform }}
21 |
The container is running Flask version {{ flask_version }} and Python {{ python_version }}
22 |
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
2 | !/.gitattributes
3 | !/.projen/tasks.json
4 | !/.projen/deps.json
5 | !/.projen/files.json
6 | !/.github/workflows/pull-request-lint.yml
7 | !/.github/workflows/auto-approve.yml
8 | !/package.json
9 | !/LICENSE
10 | !/.npmignore
11 | logs
12 | *.log
13 | npm-debug.log*
14 | yarn-debug.log*
15 | yarn-error.log*
16 | lerna-debug.log*
17 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
18 | pids
19 | *.pid
20 | *.seed
21 | *.pid.lock
22 | lib-cov
23 | coverage
24 | *.lcov
25 | .nyc_output
26 | build/Release
27 | node_modules/
28 | jspm_packages/
29 | *.tsbuildinfo
30 | .eslintcache
31 | *.tgz
32 | .yarn-integrity
33 | .cache
34 | !/.projenrc.js
35 | /test-reports/
36 | junit.xml
37 | /coverage/
38 | !/.github/workflows/build.yml
39 | !/.mergify.yml
40 | !/.github/workflows/upgrade.yml
41 | !/.github/pull_request_template.md
42 | !/test/
43 | !/tsconfig.json
44 | !/tsconfig.dev.json
45 | !/src/
46 | /lib
47 | /dist/
48 | !/.eslintrc.json
49 | /assets/
50 | !/cdk.json
51 | /cdk.out/
52 | .cdk.staging/
53 | .parcel-cache/
54 | !/.gitpod.yml
55 | cdk.out
56 | cdk.context.json
57 | dockerAssets.d
58 | yarn-error.log
59 |
--------------------------------------------------------------------------------
/dockerAssets.d/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM public.ecr.aws/amazonlinux/amazonlinux:latest
2 |
3 |
4 | ENV KUBECONFIG /home/kubectl/.kube/kubeconfig
5 | ENV HOME /home/kubectl
6 | # ENV KUBECONFIG /root/.kube/kubeconfig
7 |
8 | ARG KUBECTL_VERSION=1.18.8/2020-09-18
9 |
10 | RUN yum install -y unzip jq && \
11 | amazon-linux-extras install docker
12 |
13 | # install aws-cli v2
14 | RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
15 | unzip awscliv2.zip && \
16 | ./aws/install
17 |
18 |
19 | # RUN \
20 | # mkdir /root/bin /aws; \
21 | # apk -Uuv add groff less bash python py-pip jq curl docker && \
22 | # pip install --upgrade pip; \
23 | # pip install awscli && \
24 | # apk --purge -v del py-pip && \
25 | # rm /var/cache/apk/* && \
26 | # # Create non-root user (with a randomly chosen UID/GUI).
27 | # adduser kubectl -Du 5566
28 |
29 | # ADD https://amazon-eks.s3.us-west-2.amazonaws.com/1.15.10/2020-02-22/bin/linux/amd64/kubectl /usr/local/bin/kubectl
30 | # #COPY kubectl /usr/local/bin/kubectl
31 |
32 | # install kubectl
33 | RUN curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
34 | chmod +x kubectl && \
35 | mv kubectl /usr/local/bin/kubectl
36 |
37 | WORKDIR $HOME
38 |
39 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh
40 |
41 | RUN chmod a+x /usr/local/bin/kubectl /usr/local/bin/entrypoint.sh
42 |
43 |
44 | # USER kubectl
45 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
46 |
--------------------------------------------------------------------------------
/flask-docker-app/k8s/flask-blue-green.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: flask-svc
5 | spec:
6 | selector:
7 | app: flask
8 | ports:
9 | - name: web
10 | port: 80
11 | targetPort: 5000
12 | type: LoadBalancer
13 | ---
14 | apiVersion: apps/v1beta1
15 | kind: Deployment
16 | metadata:
17 | labels:
18 | run: flask
19 | name: flask
20 | spec:
21 | replicas: 1
22 | template:
23 | metadata:
24 | labels:
25 | app: flask
26 | spec:
27 | containers:
28 | - name: flask
29 | image: pahud/amazon-ecs-flask-sample:latest
30 | ports:
31 | - containerPort: 5000
32 | resources:
33 | limits:
34 | memory: "500Mi"
35 | cpu: "0.25"
36 | ---
37 | apiVersion: v1
38 | kind: Service
39 | metadata:
40 | name: flask-svc-green
41 | spec:
42 | selector:
43 | app: flask-green
44 | ports:
45 | - name: web
46 | port: 80
47 | targetPort: 5000
48 | type: LoadBalancer
49 | ---
50 | apiVersion: apps/v1beta1
51 | kind: Deployment
52 | metadata:
53 | labels:
54 | run: flask-green
55 | name: flask-green
56 | spec:
57 | replicas: 1
58 | template:
59 | metadata:
60 | labels:
61 | app: flask-green
62 | spec:
63 | containers:
64 | - name: flask
65 | image: pahud/amazon-ecs-flask-sample:latest
66 | ports:
67 | - containerPort: 5000
68 | resources:
69 | limits:
70 | memory: "500Mi"
71 | cpu: "0.25"
72 |
--------------------------------------------------------------------------------
/.projenrc.js:
--------------------------------------------------------------------------------
1 | const { awscdk, DevEnvironmentDockerImage, Gitpod } = require('projen');
2 |
3 | const project = new awscdk.AwsCdkTypeScriptApp({
4 | cdkVersion: '2.1.0',
5 | name: 'eks-cicd-codebuild',
6 | depsUpgradeOptions: {
7 | ignoreProjen: false,
8 | workflowOptions: {
9 | labels: ['auto-approve', 'auto-merge'],
10 | },
11 | },
12 | autoApproveOptions: {
13 | secret: 'GITHUB_TOKEN',
14 | allowedUsernames: ['pahud'],
15 | },
16 | defaultReleaseBranch: 'main',
17 | });
18 |
19 |
20 | const gitpodPrebuild = project.addTask('gitpod:prebuild', {
21 | description: 'Prebuild setup for Gitpod',
22 | });
23 | // install and compile only, do not test or package.
24 | gitpodPrebuild.exec('yarn install --frozen-lockfile --check-files');
25 | gitpodPrebuild.exec('npx projen compile');
26 |
27 | let gitpod = new Gitpod(project, {
28 | dockerImage: DevEnvironmentDockerImage.fromImage('public.ecr.aws/pahudnet/gitpod-workspace:latest'),
29 | prebuilds: {
30 | addCheck: true,
31 | addBadge: true,
32 | addLabel: true,
33 | branches: true,
34 | pullRequests: true,
35 | pullRequestsFromForks: true,
36 | },
37 | });
38 |
39 | gitpod.addCustomTask({
40 | init: 'yarn gitpod:prebuild',
41 | // always upgrade after init
42 | command: 'npx projen upgrade',
43 | });
44 |
45 | gitpod.addVscodeExtensions(
46 | 'dbaeumer.vscode-eslint',
47 | 'ms-azuretools.vscode-docker',
48 | 'AmazonWebServices.aws-toolkit-vscode',
49 | );
50 |
51 | const common_exclude = ['cdk.out', 'cdk.context.json', 'dockerAssets.d', 'yarn-error.log'];
52 | project.npmignore.exclude('images', ...common_exclude);
53 | project.gitignore.exclude(...common_exclude);
54 |
55 |
56 | project.synth();
57 |
--------------------------------------------------------------------------------
/dockerAssets.d/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # export PATH=$PATH:/root/bin
5 | HOME=/home/kubectl
6 |
7 | export KUBECONFIG=$HOME/.kube/kubeconfig
8 |
9 | start_dockerd() {
10 | /usr/bin/dockerd \
11 | --host=unix:///var/run/docker.sock \
12 | --host=tcp://127.0.0.1:2375 \
13 | --storage-driver=overlay &>/var/log/docker.log &
14 | tries=0
15 | d_timeout=60
16 | until docker info >/dev/null 2>&1
17 | do
18 | if [ "$tries" -gt "$d_timeout" ]; then
19 | cat /var/log/docker.log
20 | echo 'Timed out trying to connect to internal docker host.' >&2
21 | exit 1
22 | fi
23 | tries=$(( $tries + 1 ))
24 | sleep 1
25 | done
26 | }
27 |
28 |
29 | if [[ ! -z ${CODEBUILD_BUILD_ID} ]]; then
30 | # in AWS CodeBuild
31 | echo "found myself in AWS CodeBuild, starting dockerd..."
32 | start_dockerd
33 | fi
34 |
35 |
36 | if [[ ! -z ${AWS_REGION} ]]; then
37 | region=$AWS_REGION
38 | echo "[INFO] region=$AWS_REGION"
39 | else
40 | echo "REGION not defined, trying to lookup from EC2 metadata..."
41 | region=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq .region -r)
42 | fi
43 |
44 | # export AWS_DEFAULT_REGION=${REGION-${CODEBUILD_AGENT_ENV_CODEBUILD_REGION-$region}}
45 | export AWS_DEFAULT_REGION=$region
46 |
47 | CLUSTER_NAME=${CLUSTER_NAME-default}
48 |
49 | update_kubeconfig(){
50 | if [[ -n ${EKS_ROLE_ARN} ]]; then
51 | echo "[INFO] got EKS_ROLE_ARN=${EKS_ROLE_ARN}, updating kubeconfig with this role"
52 | aws eks update-kubeconfig --name $CLUSTER_NAME --kubeconfig $KUBECONFIG --role-arn "${EKS_ROLE_ARN}"
53 | else
54 | aws eks update-kubeconfig --name $CLUSTER_NAME --kubeconfig $KUBECONFIG
55 | fi
56 | }
57 |
58 | update_kubeconfig
59 | exec "$@"
60 |
--------------------------------------------------------------------------------
/.projen/deps.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": [
3 | {
4 | "name": "@types/jest",
5 | "type": "build"
6 | },
7 | {
8 | "name": "@types/node",
9 | "version": "^14",
10 | "type": "build"
11 | },
12 | {
13 | "name": "@typescript-eslint/eslint-plugin",
14 | "version": "^5",
15 | "type": "build"
16 | },
17 | {
18 | "name": "@typescript-eslint/parser",
19 | "version": "^5",
20 | "type": "build"
21 | },
22 | {
23 | "name": "aws-cdk",
24 | "version": "^2.1.0",
25 | "type": "build"
26 | },
27 | {
28 | "name": "esbuild",
29 | "type": "build"
30 | },
31 | {
32 | "name": "eslint-import-resolver-node",
33 | "type": "build"
34 | },
35 | {
36 | "name": "eslint-import-resolver-typescript",
37 | "type": "build"
38 | },
39 | {
40 | "name": "eslint-plugin-import",
41 | "type": "build"
42 | },
43 | {
44 | "name": "eslint",
45 | "version": "^8",
46 | "type": "build"
47 | },
48 | {
49 | "name": "jest",
50 | "type": "build"
51 | },
52 | {
53 | "name": "jest-junit",
54 | "version": "^13",
55 | "type": "build"
56 | },
57 | {
58 | "name": "json-schema",
59 | "type": "build"
60 | },
61 | {
62 | "name": "npm-check-updates",
63 | "version": "^15",
64 | "type": "build"
65 | },
66 | {
67 | "name": "projen",
68 | "type": "build"
69 | },
70 | {
71 | "name": "ts-jest",
72 | "type": "build"
73 | },
74 | {
75 | "name": "ts-node",
76 | "type": "build"
77 | },
78 | {
79 | "name": "typescript",
80 | "type": "build"
81 | },
82 | {
83 | "name": "@types/responselike",
84 | "version": "1.0.0",
85 | "type": "override"
86 | },
87 | {
88 | "name": "got",
89 | "version": "12.3.1",
90 | "type": "override"
91 | },
92 | {
93 | "name": "aws-cdk-lib",
94 | "version": "^2.1.0",
95 | "type": "runtime"
96 | },
97 | {
98 | "name": "constructs",
99 | "version": "^10.0.5",
100 | "type": "runtime"
101 | }
102 | ],
103 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
104 | }
105 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
2 |
3 | name: build
4 | on:
5 | pull_request: {}
6 | workflow_dispatch: {}
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | permissions:
11 | contents: write
12 | outputs:
13 | self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }}
14 | env:
15 | CI: "true"
16 | steps:
17 | - name: Checkout
18 | uses: actions/checkout@v3
19 | with:
20 | ref: ${{ github.event.pull_request.head.ref }}
21 | repository: ${{ github.event.pull_request.head.repo.full_name }}
22 | - name: Install dependencies
23 | run: yarn install --check-files
24 | - name: build
25 | run: npx projen build
26 | - name: Find mutations
27 | id: self_mutation
28 | run: |-
29 | git add .
30 | git diff --staged --patch --exit-code > .repo.patch || echo "::set-output name=self_mutation_happened::true"
31 | - name: Upload patch
32 | if: steps.self_mutation.outputs.self_mutation_happened
33 | uses: actions/upload-artifact@v2
34 | with:
35 | name: .repo.patch
36 | path: .repo.patch
37 | - name: Fail build on mutation
38 | if: steps.self_mutation.outputs.self_mutation_happened
39 | run: |-
40 | echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch."
41 | cat .repo.patch
42 | exit 1
43 | self-mutation:
44 | needs: build
45 | runs-on: ubuntu-latest
46 | permissions:
47 | contents: write
48 | if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository)
49 | steps:
50 | - name: Checkout
51 | uses: actions/checkout@v3
52 | with:
53 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
54 | ref: ${{ github.event.pull_request.head.ref }}
55 | repository: ${{ github.event.pull_request.head.repo.full_name }}
56 | - name: Download patch
57 | uses: actions/download-artifact@v3
58 | with:
59 | name: .repo.patch
60 | path: ${{ runner.temp }}
61 | - name: Apply patch
62 | run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
63 | - name: Set git identity
64 | run: |-
65 | git config user.name "github-actions"
66 | git config user.email "github-actions@github.com"
67 | - name: Push changes
68 | run: |2-
69 | git add .
70 | git commit -s -m "chore: self mutation"
71 | git push origin HEAD:${{ github.event.pull_request.head.ref }}
72 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eks-cicd-codebuild",
3 | "scripts": {
4 | "build": "npx projen build",
5 | "bundle": "npx projen bundle",
6 | "clobber": "npx projen clobber",
7 | "compile": "npx projen compile",
8 | "default": "npx projen default",
9 | "deploy": "npx projen deploy",
10 | "destroy": "npx projen destroy",
11 | "diff": "npx projen diff",
12 | "eject": "npx projen eject",
13 | "eslint": "npx projen eslint",
14 | "gitpod:prebuild": "npx projen gitpod:prebuild",
15 | "package": "npx projen package",
16 | "post-compile": "npx projen post-compile",
17 | "post-upgrade": "npx projen post-upgrade",
18 | "pre-compile": "npx projen pre-compile",
19 | "synth": "npx projen synth",
20 | "synth:silent": "npx projen synth:silent",
21 | "test": "npx projen test",
22 | "test:watch": "npx projen test:watch",
23 | "upgrade": "npx projen upgrade",
24 | "watch": "npx projen watch",
25 | "projen": "npx projen"
26 | },
27 | "devDependencies": {
28 | "@types/jest": "^29.1.1",
29 | "@types/node": "^14",
30 | "@typescript-eslint/eslint-plugin": "^5",
31 | "@typescript-eslint/parser": "^5",
32 | "aws-cdk": "^2.1.0",
33 | "esbuild": "^0.15.10",
34 | "eslint": "^8",
35 | "eslint-import-resolver-node": "^0.3.6",
36 | "eslint-import-resolver-typescript": "^3.5.1",
37 | "eslint-plugin-import": "^2.26.0",
38 | "jest": "^29.1.2",
39 | "jest-junit": "^13",
40 | "json-schema": "^0.4.0",
41 | "npm-check-updates": "^15",
42 | "projen": "^0.63.6",
43 | "ts-jest": "^29.0.3",
44 | "ts-node": "^10.9.1",
45 | "typescript": "^4.8.4"
46 | },
47 | "dependencies": {
48 | "aws-cdk-lib": "^2.1.0",
49 | "constructs": "^10.0.5"
50 | },
51 | "license": "Apache-2.0",
52 | "version": "0.0.0",
53 | "jest": {
54 | "testMatch": [
55 | "
/src/**/__tests__/**/*.ts?(x)",
56 | "/(test|src)/**/*(*.)@(spec|test).ts?(x)"
57 | ],
58 | "clearMocks": true,
59 | "collectCoverage": true,
60 | "coverageReporters": [
61 | "json",
62 | "lcov",
63 | "clover",
64 | "cobertura",
65 | "text"
66 | ],
67 | "coverageDirectory": "coverage",
68 | "coveragePathIgnorePatterns": [
69 | "/node_modules/"
70 | ],
71 | "testPathIgnorePatterns": [
72 | "/node_modules/"
73 | ],
74 | "watchPathIgnorePatterns": [
75 | "/node_modules/"
76 | ],
77 | "reporters": [
78 | "default",
79 | [
80 | "jest-junit",
81 | {
82 | "outputDirectory": "test-reports"
83 | }
84 | ]
85 | ],
86 | "preset": "ts-jest",
87 | "globals": {
88 | "ts-jest": {
89 | "tsconfig": "tsconfig.dev.json"
90 | }
91 | }
92 | },
93 | "resolutions": {
94 | "@types/responselike": "1.0.0",
95 | "got": "12.3.1"
96 | },
97 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
98 | }
99 |
--------------------------------------------------------------------------------
/.github/workflows/upgrade.yml:
--------------------------------------------------------------------------------
1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
2 |
3 | name: upgrade
4 | on:
5 | workflow_dispatch: {}
6 | schedule:
7 | - cron: 0 0 * * *
8 | jobs:
9 | upgrade:
10 | name: Upgrade
11 | runs-on: ubuntu-latest
12 | permissions:
13 | contents: read
14 | outputs:
15 | patch_created: ${{ steps.create_patch.outputs.patch_created }}
16 | steps:
17 | - name: Checkout
18 | uses: actions/checkout@v3
19 | - name: Install dependencies
20 | run: yarn install --check-files --frozen-lockfile
21 | - name: Upgrade dependencies
22 | run: npx projen upgrade
23 | - name: Find mutations
24 | id: create_patch
25 | run: |-
26 | git add .
27 | git diff --staged --patch --exit-code > .repo.patch || echo "::set-output name=patch_created::true"
28 | - name: Upload patch
29 | if: steps.create_patch.outputs.patch_created
30 | uses: actions/upload-artifact@v2
31 | with:
32 | name: .repo.patch
33 | path: .repo.patch
34 | pr:
35 | name: Create Pull Request
36 | needs: upgrade
37 | runs-on: ubuntu-latest
38 | permissions:
39 | contents: write
40 | pull-requests: write
41 | if: ${{ needs.upgrade.outputs.patch_created }}
42 | steps:
43 | - name: Checkout
44 | uses: actions/checkout@v3
45 | with:
46 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
47 | - name: Download patch
48 | uses: actions/download-artifact@v3
49 | with:
50 | name: .repo.patch
51 | path: ${{ runner.temp }}
52 | - name: Apply patch
53 | run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
54 | - name: Set git identity
55 | run: |-
56 | git config user.name "github-actions"
57 | git config user.email "github-actions@github.com"
58 | - name: Create Pull Request
59 | id: create-pr
60 | uses: peter-evans/create-pull-request@v3
61 | with:
62 | token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
63 | commit-message: |-
64 | chore(deps): upgrade dependencies
65 |
66 | Upgrades project dependencies. See details in [workflow run].
67 |
68 | [Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
69 |
70 | ------
71 |
72 | *Automatically created by projen via the "upgrade" workflow*
73 | branch: github-actions/upgrade
74 | title: "chore(deps): upgrade dependencies"
75 | labels: auto-approve,auto-merge
76 | body: |-
77 | Upgrades project dependencies. See details in [workflow run].
78 |
79 | [Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
80 |
81 | ------
82 |
83 | *Automatically created by projen via the "upgrade" workflow*
84 | author: github-actions
85 | committer: github-actions
86 | signoff: true
87 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing Guidelines
2 |
3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4 | documentation, we greatly value feedback and contributions from our community.
5 |
6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7 | information to effectively respond to your bug report or contribution.
8 |
9 | ## Reporting Bugs/Feature Requests
10 |
11 | We welcome you to use the GitHub issue tracker to report bugs or suggest features.
12 |
13 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
14 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
15 |
16 | * A reproducible test case or series of steps
17 | * The version of our code being used
18 | * Any modifications you've made relevant to the bug
19 | * Anything unusual about your environment or deployment
20 |
21 | ## Contributing via Pull Requests
22 |
23 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
24 |
25 | 1. You are working against the latest source on the *master* branch.
26 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
27 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
28 |
29 | To send us a pull request, please:
30 |
31 | 1. Fork the repository.
32 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
33 | 3. Ensure local tests pass.
34 | 4. Commit to your fork using clear commit messages.
35 | 5. Send us a pull request, answering any default questions in the pull request interface.
36 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
37 |
38 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
39 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
40 |
41 | ## Finding contributions to work on
42 |
43 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
44 |
45 | ## Code of Conduct
46 |
47 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
48 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
49 | opensource-codeofconduct@amazon.com with any additional questions or comments.
50 |
51 | ## Security issue notifications
52 |
53 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
54 |
55 | ## Licensing
56 |
57 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
58 |
59 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
60 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 | import {
3 | Stack, App, CfnOutput,
4 | aws_codebuild as codebuild,
5 | aws_codecommit as codecommit,
6 | aws_ec2 as ec2,
7 | aws_ecr as ecr,
8 | aws_eks as eks,
9 | aws_events_targets as targets,
10 | aws_iam as iam,
11 | } from 'aws-cdk-lib';
12 | import { Construct } from 'constructs';
13 |
14 | export class Demo extends Construct {
15 | constructor(scope: Construct, id: string) {
16 | super(scope, id);
17 |
18 | const vpc = getOrCreateVpc(this);
19 | const cluster = new eks.Cluster(this, 'Cluster', {
20 | vpc,
21 | version: eks.KubernetesVersion.V1_20,
22 | defaultCapacity: 2,
23 | });
24 |
25 | const stackName = Stack.of(this).stackName;
26 |
27 | const ecrRepo = new ecr.Repository(this, 'EcrRepo');
28 |
29 | const repository = new codecommit.Repository(this, 'CodeCommitRepo', {
30 | repositoryName: `${stackName}-repo`,
31 | });
32 |
33 | const project = new codebuild.Project(this, 'MyProject', {
34 | projectName: `${stackName}`,
35 | source: codebuild.Source.codeCommit({ repository }),
36 | environment: {
37 | buildImage: codebuild.LinuxBuildImage.fromAsset(this, 'CustomImage', {
38 | directory: path.join(__dirname, '../dockerAssets.d'),
39 | }),
40 | privileged: true,
41 | },
42 | environmentVariables: {
43 | CLUSTER_NAME: {
44 | value: `${cluster.clusterName}`,
45 | },
46 | ECR_REPO_URI: {
47 | value: `${ecrRepo.repositoryUri}`,
48 | },
49 | },
50 | buildSpec: codebuild.BuildSpec.fromObject({
51 | version: '0.2',
52 | phases: {
53 | pre_build: {
54 | commands: [
55 | 'env',
56 | 'export TAG=${CODEBUILD_RESOLVED_SOURCE_VERSION}',
57 | 'export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output=text)',
58 | '/usr/local/bin/entrypoint.sh',
59 | 'echo Logging in to Amazon ECR',
60 | 'aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com',
61 | ],
62 | },
63 | build: {
64 | commands: [
65 | 'cd flask-docker-app',
66 | 'docker build -t $ECR_REPO_URI:$TAG .',
67 | 'docker push $ECR_REPO_URI:$TAG',
68 | ],
69 | },
70 | post_build: {
71 | commands: [
72 | 'kubectl get no',
73 | 'kubectl set image deployment flask-deployment flask=$ECR_REPO_URI:$TAG',
74 | ],
75 | },
76 | },
77 | }),
78 | });
79 |
80 | repository.onCommit('OnCommit', {
81 | target: new targets.CodeBuildProject(project),
82 | });
83 |
84 | ecrRepo.grantPullPush(project.role!);
85 | cluster.awsAuth.addMastersRole(project.role!);
86 | project.addToRolePolicy(new iam.PolicyStatement({
87 | actions: ['eks:DescribeCluster'],
88 | resources: [`${cluster.clusterArn}`],
89 | }));
90 |
91 | new CfnOutput(this, 'CodeCommitRepoName', { value: `${repository.repositoryName}` });
92 | new CfnOutput(this, 'CodeCommitRepoArn', { value: `${repository.repositoryArn}` });
93 | new CfnOutput(this, 'CodeCommitCloneUrlSsh', { value: `${repository.repositoryCloneUrlSsh}` });
94 | new CfnOutput(this, 'CodeCommitCloneUrlHttp', { value: `${repository.repositoryCloneUrlHttp}` });
95 | }
96 | }
97 |
98 | const app = new App();
99 |
100 | const env = {
101 | region: process.env.CDK_DEFAULT_REGION || 'us-east-1',
102 | account: process.env.CDK_DEFAULT_ACCOUNT,
103 | };
104 |
105 | const stack = new Stack(app, 'eks-cicd-codebuild-stack', { env });
106 |
107 | new Demo(stack, 'demo');
108 |
109 | function getOrCreateVpc(scope: Construct): ec2.IVpc {
110 | // use an existing vpc or create a new one
111 | return scope.node.tryGetContext('use_default_vpc') === '1'
112 | || process.env.CDK_USE_DEFAULT_VPC === '1' ? ec2.Vpc.fromLookup(scope, 'Vpc', { isDefault: true }) :
113 | scope.node.tryGetContext('use_vpc_id') ?
114 | ec2.Vpc.fromLookup(scope, 'Vpc', { vpcId: scope.node.tryGetContext('use_vpc_id') }) :
115 | new ec2.Vpc(scope, 'Vpc', { maxAzs: 3, natGateways: 1 });
116 | }
117 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "jest": true,
4 | "node": true
5 | },
6 | "root": true,
7 | "plugins": [
8 | "@typescript-eslint",
9 | "import"
10 | ],
11 | "parser": "@typescript-eslint/parser",
12 | "parserOptions": {
13 | "ecmaVersion": 2018,
14 | "sourceType": "module",
15 | "project": "./tsconfig.dev.json"
16 | },
17 | "extends": [
18 | "plugin:import/typescript"
19 | ],
20 | "settings": {
21 | "import/parsers": {
22 | "@typescript-eslint/parser": [
23 | ".ts",
24 | ".tsx"
25 | ]
26 | },
27 | "import/resolver": {
28 | "node": {},
29 | "typescript": {
30 | "project": "./tsconfig.dev.json",
31 | "alwaysTryTypes": true
32 | }
33 | }
34 | },
35 | "ignorePatterns": [
36 | "*.js",
37 | "!.projenrc.js",
38 | "*.d.ts",
39 | "node_modules/",
40 | "*.generated.ts",
41 | "coverage"
42 | ],
43 | "rules": {
44 | "indent": [
45 | "off"
46 | ],
47 | "@typescript-eslint/indent": [
48 | "error",
49 | 2
50 | ],
51 | "quotes": [
52 | "error",
53 | "single",
54 | {
55 | "avoidEscape": true
56 | }
57 | ],
58 | "comma-dangle": [
59 | "error",
60 | "always-multiline"
61 | ],
62 | "comma-spacing": [
63 | "error",
64 | {
65 | "before": false,
66 | "after": true
67 | }
68 | ],
69 | "no-multi-spaces": [
70 | "error",
71 | {
72 | "ignoreEOLComments": false
73 | }
74 | ],
75 | "array-bracket-spacing": [
76 | "error",
77 | "never"
78 | ],
79 | "array-bracket-newline": [
80 | "error",
81 | "consistent"
82 | ],
83 | "object-curly-spacing": [
84 | "error",
85 | "always"
86 | ],
87 | "object-curly-newline": [
88 | "error",
89 | {
90 | "multiline": true,
91 | "consistent": true
92 | }
93 | ],
94 | "object-property-newline": [
95 | "error",
96 | {
97 | "allowAllPropertiesOnSameLine": true
98 | }
99 | ],
100 | "keyword-spacing": [
101 | "error"
102 | ],
103 | "brace-style": [
104 | "error",
105 | "1tbs",
106 | {
107 | "allowSingleLine": true
108 | }
109 | ],
110 | "space-before-blocks": [
111 | "error"
112 | ],
113 | "curly": [
114 | "error",
115 | "multi-line",
116 | "consistent"
117 | ],
118 | "@typescript-eslint/member-delimiter-style": [
119 | "error"
120 | ],
121 | "semi": [
122 | "error",
123 | "always"
124 | ],
125 | "max-len": [
126 | "error",
127 | {
128 | "code": 150,
129 | "ignoreUrls": true,
130 | "ignoreStrings": true,
131 | "ignoreTemplateLiterals": true,
132 | "ignoreComments": true,
133 | "ignoreRegExpLiterals": true
134 | }
135 | ],
136 | "quote-props": [
137 | "error",
138 | "consistent-as-needed"
139 | ],
140 | "@typescript-eslint/no-require-imports": [
141 | "error"
142 | ],
143 | "import/no-extraneous-dependencies": [
144 | "error",
145 | {
146 | "devDependencies": [
147 | "**/test/**",
148 | "**/build-tools/**"
149 | ],
150 | "optionalDependencies": false,
151 | "peerDependencies": true
152 | }
153 | ],
154 | "import/no-unresolved": [
155 | "error"
156 | ],
157 | "import/order": [
158 | "warn",
159 | {
160 | "groups": [
161 | "builtin",
162 | "external"
163 | ],
164 | "alphabetize": {
165 | "order": "asc",
166 | "caseInsensitive": true
167 | }
168 | }
169 | ],
170 | "no-duplicate-imports": [
171 | "error"
172 | ],
173 | "no-shadow": [
174 | "off"
175 | ],
176 | "@typescript-eslint/no-shadow": [
177 | "error"
178 | ],
179 | "key-spacing": [
180 | "error"
181 | ],
182 | "no-multiple-empty-lines": [
183 | "error"
184 | ],
185 | "@typescript-eslint/no-floating-promises": [
186 | "error"
187 | ],
188 | "no-return-await": [
189 | "off"
190 | ],
191 | "@typescript-eslint/return-await": [
192 | "error"
193 | ],
194 | "no-trailing-spaces": [
195 | "error"
196 | ],
197 | "dot-notation": [
198 | "error"
199 | ],
200 | "no-bitwise": [
201 | "error"
202 | ],
203 | "@typescript-eslint/member-ordering": [
204 | "error",
205 | {
206 | "default": [
207 | "public-static-field",
208 | "public-static-method",
209 | "protected-static-field",
210 | "protected-static-method",
211 | "private-static-field",
212 | "private-static-method",
213 | "field",
214 | "constructor",
215 | "method"
216 | ]
217 | }
218 | ]
219 | },
220 | "overrides": [
221 | {
222 | "files": [
223 | ".projenrc.js"
224 | ],
225 | "rules": {
226 | "@typescript-eslint/no-require-imports": "off",
227 | "import/no-extraneous-dependencies": "off"
228 | }
229 | }
230 | ]
231 | }
232 |
--------------------------------------------------------------------------------
/.projen/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "tasks": {
3 | "build": {
4 | "name": "build",
5 | "description": "Full release build",
6 | "steps": [
7 | {
8 | "spawn": "default"
9 | },
10 | {
11 | "spawn": "pre-compile"
12 | },
13 | {
14 | "spawn": "compile"
15 | },
16 | {
17 | "spawn": "post-compile"
18 | },
19 | {
20 | "spawn": "test"
21 | },
22 | {
23 | "spawn": "package"
24 | }
25 | ]
26 | },
27 | "bundle": {
28 | "name": "bundle",
29 | "description": "Prepare assets"
30 | },
31 | "clobber": {
32 | "name": "clobber",
33 | "description": "hard resets to HEAD of origin and cleans the local repo",
34 | "env": {
35 | "BRANCH": "$(git branch --show-current)"
36 | },
37 | "steps": [
38 | {
39 | "exec": "git checkout -b scratch",
40 | "name": "save current HEAD in \"scratch\" branch"
41 | },
42 | {
43 | "exec": "git checkout $BRANCH"
44 | },
45 | {
46 | "exec": "git fetch origin",
47 | "name": "fetch latest changes from origin"
48 | },
49 | {
50 | "exec": "git reset --hard origin/$BRANCH",
51 | "name": "hard reset to origin commit"
52 | },
53 | {
54 | "exec": "git clean -fdx",
55 | "name": "clean all untracked files"
56 | },
57 | {
58 | "say": "ready to rock! (unpushed commits are under the \"scratch\" branch)"
59 | }
60 | ],
61 | "condition": "git diff --exit-code > /dev/null"
62 | },
63 | "compile": {
64 | "name": "compile",
65 | "description": "Only compile"
66 | },
67 | "default": {
68 | "name": "default",
69 | "description": "Synthesize project files",
70 | "steps": [
71 | {
72 | "exec": "node .projenrc.js"
73 | }
74 | ]
75 | },
76 | "deploy": {
77 | "name": "deploy",
78 | "description": "Deploys your CDK app to the AWS cloud",
79 | "steps": [
80 | {
81 | "exec": "cdk deploy"
82 | }
83 | ]
84 | },
85 | "destroy": {
86 | "name": "destroy",
87 | "description": "Destroys your cdk app in the AWS cloud",
88 | "steps": [
89 | {
90 | "exec": "cdk destroy"
91 | }
92 | ]
93 | },
94 | "diff": {
95 | "name": "diff",
96 | "description": "Diffs the currently deployed app against your code",
97 | "steps": [
98 | {
99 | "exec": "cdk diff"
100 | }
101 | ]
102 | },
103 | "eject": {
104 | "name": "eject",
105 | "description": "Remove projen from the project",
106 | "env": {
107 | "PROJEN_EJECTING": "true"
108 | },
109 | "steps": [
110 | {
111 | "spawn": "default"
112 | }
113 | ]
114 | },
115 | "eslint": {
116 | "name": "eslint",
117 | "description": "Runs eslint against the codebase",
118 | "steps": [
119 | {
120 | "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools .projenrc.js"
121 | }
122 | ]
123 | },
124 | "gitpod:prebuild": {
125 | "name": "gitpod:prebuild",
126 | "description": "Prebuild setup for Gitpod",
127 | "steps": [
128 | {
129 | "exec": "yarn install --frozen-lockfile --check-files"
130 | },
131 | {
132 | "exec": "npx projen compile"
133 | }
134 | ]
135 | },
136 | "package": {
137 | "name": "package",
138 | "description": "Creates the distribution package"
139 | },
140 | "post-compile": {
141 | "name": "post-compile",
142 | "description": "Runs after successful compilation",
143 | "steps": [
144 | {
145 | "spawn": "synth:silent"
146 | }
147 | ]
148 | },
149 | "post-upgrade": {
150 | "name": "post-upgrade",
151 | "description": "Runs after upgrading dependencies"
152 | },
153 | "pre-compile": {
154 | "name": "pre-compile",
155 | "description": "Prepare the project for compilation"
156 | },
157 | "synth": {
158 | "name": "synth",
159 | "description": "Synthesizes your cdk app into cdk.out",
160 | "steps": [
161 | {
162 | "exec": "cdk synth"
163 | }
164 | ]
165 | },
166 | "synth:silent": {
167 | "name": "synth:silent",
168 | "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of \"yarn build\")",
169 | "steps": [
170 | {
171 | "exec": "cdk synth -q"
172 | }
173 | ]
174 | },
175 | "test": {
176 | "name": "test",
177 | "description": "Run tests",
178 | "steps": [
179 | {
180 | "exec": "jest --passWithNoTests --all --updateSnapshot"
181 | },
182 | {
183 | "spawn": "eslint"
184 | }
185 | ]
186 | },
187 | "test:watch": {
188 | "name": "test:watch",
189 | "description": "Run jest in watch mode",
190 | "steps": [
191 | {
192 | "exec": "jest --watch"
193 | }
194 | ]
195 | },
196 | "upgrade": {
197 | "name": "upgrade",
198 | "description": "upgrade dependencies",
199 | "env": {
200 | "CI": "0"
201 | },
202 | "steps": [
203 | {
204 | "exec": "yarn upgrade npm-check-updates"
205 | },
206 | {
207 | "exec": "npm-check-updates --dep dev --upgrade --target=minor"
208 | },
209 | {
210 | "exec": "npm-check-updates --dep optional --upgrade --target=minor"
211 | },
212 | {
213 | "exec": "npm-check-updates --dep peer --upgrade --target=minor"
214 | },
215 | {
216 | "exec": "npm-check-updates --dep prod --upgrade --target=minor"
217 | },
218 | {
219 | "exec": "npm-check-updates --dep bundle --upgrade --target=minor"
220 | },
221 | {
222 | "exec": "yarn install --check-files"
223 | },
224 | {
225 | "exec": "yarn upgrade"
226 | },
227 | {
228 | "exec": "npx projen"
229 | },
230 | {
231 | "spawn": "post-upgrade"
232 | }
233 | ]
234 | },
235 | "watch": {
236 | "name": "watch",
237 | "description": "Watches changes in your source code and rebuilds and deploys to the current account",
238 | "steps": [
239 | {
240 | "exec": "cdk deploy --hotswap"
241 | },
242 | {
243 | "exec": "cdk watch"
244 | }
245 | ]
246 | }
247 | },
248 | "env": {
249 | "PATH": "$(npx -c \"node -e \\\"console.log(process.env.PATH)\\\"\")"
250 | },
251 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
252 | }
253 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Amazon EKS CI/CD with AWS CodeBuild
2 |
3 | This project helps you build a complete Amazon EKS cluster with nodegroup and CI/CD pipeline with CodeBuild 100% in **AWS CDK**.
4 |
5 | 
6 |
7 | ## Resource List
8 |
9 | This stack provisions the following resources with **AWS CDK**
10 |
11 | - [x] **Amazon EKS cluster**
12 | - [x] **Amazon EKS nodegroup (with 2 m5.large workers)**
13 | - [x] **AWS CodeBuild Project for Amazon EKS CI/CD**
14 | - [x] **AWS CodeCommit as a sample source repo**
15 | - [x] **Amazon ECR repository**
16 |
17 |
18 | ## Pre-requisities
19 | - [x] **AWS CDK >= 1.82.0** - check [Getting Started with AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html) to setup your CDK environment. Run `cdk --version` to check the CLI version.
20 | - [x] **Docker** - AWS CDK will build a docker image from local for codebuild environment. Make sure you have installed docker in your client.
21 |
22 |
23 | ## Usage
24 |
25 | Just deploy the stack with AWS CDK
26 |
27 | ```bash
28 | $ git clone https://github.com/aws-samples/amazon-eks-cicd-codebuild.git
29 | $ cd amazon-eks-cicd-codebuild
30 | # install required packages
31 | $ yarn install
32 | # if you have not used cdk in this account previously you may be advised to create the necessary resources in the account
33 | $ cdk bootstrap aws://ACCOUNTNUMBER/us-east-1
34 | # check the diff before deployment
35 | $ cdk diff
36 | # deploy the complete stack
37 | $ cdk deploy
38 | # when finished with the demo delete the created resources
39 | # note that the flask resources were created independently of the cdk and must be deleted first
40 | $ kubectl delete svc/flask-svc deploy/flask-deployment
41 | $ cdk destroy
42 | ```
43 |
44 |
45 |
46 |
47 |
48 | ## Walkthrough
49 |
50 | When you complete the `cdk deploy`, an empty **CodeCommit** repository will be created(check `Resource List` above to see all resource being created)
51 |
52 | ```bash
53 | Outputs:
54 | eks-cicd-codebuild-stack.ClusterConfigCommand43AAE40F = aws eks update-kubeconfig --name Cluster9EE0221C-96a69d282e344526afd711d2d3014150 --region ap-northeast-1 --role-arn arn:aws:iam::112233445566:role/eks-cicd-codebuild-stack-ClusterMastersRole9AA3562-1Q06U5NB9DP2Q
55 | eks-cicd-codebuild-stack.ClusterGetTokenCommand06AE992E = aws eks get-token --cluster-name Cluster9EE0221C-96a69d282e344526afd711d2d3014150 --region ap-northeast-1 --role-arn arn:aws:iam::112233445566:role/eks-cicd-codebuild-stack-ClusterMastersRole9AA3562-1Q06U5NB9DP2Q
56 | eks-cicd-codebuild-stack.CodeCommitCloneUrlHttp = https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/eks-cicd-codebuild-stack-repo
57 | eks-cicd-codebuild-stack.CodeCommitCloneUrlSsh = ssh://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/eks-cicd-codebuild-stack-repo
58 | eks-cicd-codebuild-stack.CodeCommitRepoArn = arn:aws:codecommit:ap-northeast-1:112233445566:eks-cicd-codebuild-stack-repo
59 | eks-cicd-codebuild-stack.CodeCommitRepoName = eks-cicd-codebuild-stack-repo
60 | ```
61 |
62 | Verify the Amazon EKS is running **kubectl**
63 |
64 | ```bash
65 | # copy the 'aws eks update-kubeconfig' command string and run it in the terminal to generate/update the kubeconfig
66 | $ aws eks update-kubeconfig --name Cluster9EE0221C-96a69d282e344526afd711d2d3014150 --region ap-northeast-1 --role-arn arn:aws:iam::112233445566:role/eks-cicd-codebuild-stack-ClusterMastersRole9AA3562-1Q06U5NB9DP2Q
67 | # list the nodes with kubectl
68 | $ kubectl get no
69 | # deploy the initial flask sample service
70 | $ kubectl apply -f flask-docker-app/k8s/flask.yaml
71 | # list the service and deployment
72 | $ kubectl get svc,deploy
73 | ```
74 |
75 | Copy the ELB dns name from the **EXTERNAL-IP** column and open it in browser.
76 |
77 | You will see the **Flask-demo** homepage.
78 |
79 | 
80 |
81 | ```bash
82 | # copy the ELB dns name from the EXTERNAL-IP column and open it in browser.
83 | # You will see the Flask-demo homepage
84 | # set codecommit as another upstream
85 | $ git remote add codecommit ssh://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/eks-cicd-codebuild-stack-repo
86 | # push all current repo to codecommit. This will trigger CodeBuild for CI/CD.
87 | $ git push -u codecommit master
88 | ```
89 |
90 | Check the **CodeBuild** console to see the build status.
91 |
92 | On build complete, reload the browser and see the **Flask-demo** homepage again. You will see the running platform string has changed from **Amazon Web Services** to **Amazon EKS**.
93 |
94 | 
95 |
96 | You may edit the `Dockerfile` in **flask-docker-app** directory and specify different **PLATFORM** value
97 |
98 | ```bash
99 | ENV PLATFORM 'Amazon EKS'
100 | ```
101 |
102 | After you **git add**, **git commit** and **git push** to the **CodeCommit** source repository, **CodeBuild** will rebuild the docker image with new tag, push to Amazon ECR and immediately update the kubernetes deployment again. You may reload the browser to see the changes.
103 |
104 | ## FAQ
105 |
106 | Q: when I `cdk deploy`, I got can't find **CDK_DEFAULT_REGION** or **CDK_DEFAULT_ACCOUNT** error.
107 |
108 | A: You need configure your CDK environment, check [this chapter](https://docs.aws.amazon.com/en_us/cdk/latest/guide/environments.html) in AWS CDK Developer Guide to configure your Environment correctly.
109 |
110 | Q: when I `cdk deploy`, I got error while load metadata for public.ecr.aws/amazonlinux/amazonlinux:latest.
111 |
112 | A: Try to run below command.
113 |
114 | `docker pull public.ecr.aws/amazonlinux/amazonlinux:latest`
115 |
116 | If you encounter the following error
117 |
118 | >Error response from daemon: pull access denied for public.ecr.aws/amazonlinux/amazonlinux, repository does not exist or may require 'docker login': denied: Your authorization token has expired. Reauthenticate and try again.
119 |
120 | You may need docker login to authenticate against the ecr-public like
121 |
122 | `aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/amazonlinux`
123 |
124 | Q: How can I deploy to a default VPC or any existing one?
125 |
126 | A:
127 |
128 | ```bash
129 | # deploy to the default VPC
130 | $ cdk deploy -c use_default_vpc=1
131 | # Or to deploy to VPC ID vpc-xxxxxx
132 | $ cdk deploy -c use_vpc_id=vpc-xxxxxx
133 | ```
134 | (You are encouraged to run `cdk diff` with the -c to view the difference first.)
135 |
136 | However, if you create a new VPC, you might not be able to `cdk destroy` it after you `kubectl apply` some services in this VPC. Check [#5](https://github.com/aws-samples/amazon-eks-cicd-codebuild/issues/5) for more details and instructions.
137 |
138 | Q: Got **VPC is not symmetric error** for default VPC
139 |
140 | A: The **ec2.Vpc.fromLookup()** assumes the VPC specified is symmetric, check the [doc](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-ec2-readme.html) here. If you specify the default VPC and get this error, you probably need to check if you have public and private subnets in every AZ and make sure they are symmetric. (Ref: [aws/aws-cdk/issues/3407](https://github.com/aws/aws-cdk/issues/3407))
141 |
142 | Q: Can I build this with my existing Amazon EKS cluster?
143 |
144 | A: Yes. You can import the existing Amazon EKS cluster with **eks.Cluster.fromClusterAttributes()**
145 |
146 | Q: The *cdk destroy* fails due to dependencies that cannot be deleted
147 |
148 | A: The flask app dependencies must be deleted with kubectl before the *cdk destroy*
149 |
150 | ## License
151 |
152 | This library is licensed under the MIT-0 License. See the [LICENSE](/LICENSE) file.
153 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/flask-docker-app/static/css/bootstrap-responsive.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.2.2
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
10 |
--------------------------------------------------------------------------------
/test/__snapshots__/main.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Snapshot 1`] = `
4 | {
5 | "Outputs": {
6 | "DemoClusterConfigCommandFF969510": {
7 | "Value": {
8 | "Fn::Join": [
9 | "",
10 | [
11 | "aws eks update-kubeconfig --name ",
12 | {
13 | "Ref": "DemoCluster38441829",
14 | },
15 | " --region ",
16 | {
17 | "Ref": "AWS::Region",
18 | },
19 | " --role-arn ",
20 | {
21 | "Fn::GetAtt": [
22 | "DemoClusterMastersRoleAFB55B87",
23 | "Arn",
24 | ],
25 | },
26 | ],
27 | ],
28 | },
29 | },
30 | "DemoClusterGetTokenCommand27D195FA": {
31 | "Value": {
32 | "Fn::Join": [
33 | "",
34 | [
35 | "aws eks get-token --cluster-name ",
36 | {
37 | "Ref": "DemoCluster38441829",
38 | },
39 | " --region ",
40 | {
41 | "Ref": "AWS::Region",
42 | },
43 | " --role-arn ",
44 | {
45 | "Fn::GetAtt": [
46 | "DemoClusterMastersRoleAFB55B87",
47 | "Arn",
48 | ],
49 | },
50 | ],
51 | ],
52 | },
53 | },
54 | "DemoCodeCommitCloneUrlHttp8110DB84": {
55 | "Value": {
56 | "Fn::GetAtt": [
57 | "DemoCodeCommitRepo0DD21DC2",
58 | "CloneUrlHttp",
59 | ],
60 | },
61 | },
62 | "DemoCodeCommitCloneUrlSsh3FC28E78": {
63 | "Value": {
64 | "Fn::GetAtt": [
65 | "DemoCodeCommitRepo0DD21DC2",
66 | "CloneUrlSsh",
67 | ],
68 | },
69 | },
70 | "DemoCodeCommitRepoArnA87270C7": {
71 | "Value": {
72 | "Fn::GetAtt": [
73 | "DemoCodeCommitRepo0DD21DC2",
74 | "Arn",
75 | ],
76 | },
77 | },
78 | "DemoCodeCommitRepoName35983F42": {
79 | "Value": {
80 | "Fn::GetAtt": [
81 | "DemoCodeCommitRepo0DD21DC2",
82 | "Name",
83 | ],
84 | },
85 | },
86 | },
87 | "Parameters": {
88 | "BootstrapVersion": {
89 | "Default": "/cdk-bootstrap/hnb659fds/version",
90 | "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]",
91 | "Type": "AWS::SSM::Parameter::Value",
92 | },
93 | },
94 | "Resources": {
95 | "DemoCluster38441829": {
96 | "DeletionPolicy": "Delete",
97 | "DependsOn": [
98 | "DemoClusterCreationRoleDefaultPolicy5FA9659F",
99 | "DemoClusterCreationRole8978C51F",
100 | "DemoVpcIGW4CCD8DC2",
101 | "DemoVpcPrivateSubnet1DefaultRoute88DBC596",
102 | "DemoVpcPrivateSubnet1RouteTable0882FEB1",
103 | "DemoVpcPrivateSubnet1RouteTableAssociation810E5915",
104 | "DemoVpcPrivateSubnet1Subnet44F848DB",
105 | "DemoVpcPrivateSubnet2DefaultRouteCE36B950",
106 | "DemoVpcPrivateSubnet2RouteTable40B6F8E2",
107 | "DemoVpcPrivateSubnet2RouteTableAssociation625EC3BF",
108 | "DemoVpcPrivateSubnet2Subnet2CBBAF70",
109 | "DemoVpcPublicSubnet1DefaultRoute9F0A2508",
110 | "DemoVpcPublicSubnet1EIP504508F1",
111 | "DemoVpcPublicSubnet1NATGateway1792712A",
112 | "DemoVpcPublicSubnet1RouteTable7E6F7541",
113 | "DemoVpcPublicSubnet1RouteTableAssociationB6894BAD",
114 | "DemoVpcPublicSubnet1SubnetF3653284",
115 | "DemoVpcPublicSubnet2DefaultRoute61C7597A",
116 | "DemoVpcPublicSubnet2RouteTableCAAA2786",
117 | "DemoVpcPublicSubnet2RouteTableAssociation2BD8C06E",
118 | "DemoVpcPublicSubnet2Subnet95D7A6DB",
119 | "DemoVpc45BBFD6B",
120 | "DemoVpcVPCGWFC8D4299",
121 | ],
122 | "Properties": {
123 | "AssumeRoleArn": {
124 | "Fn::GetAtt": [
125 | "DemoClusterCreationRole8978C51F",
126 | "Arn",
127 | ],
128 | },
129 | "AttributesRevision": 2,
130 | "Config": {
131 | "resourcesVpcConfig": {
132 | "endpointPrivateAccess": true,
133 | "endpointPublicAccess": true,
134 | "securityGroupIds": [
135 | {
136 | "Fn::GetAtt": [
137 | "DemoClusterControlPlaneSecurityGroup6BA5AFA1",
138 | "GroupId",
139 | ],
140 | },
141 | ],
142 | "subnetIds": [
143 | {
144 | "Ref": "DemoVpcPublicSubnet1SubnetF3653284",
145 | },
146 | {
147 | "Ref": "DemoVpcPublicSubnet2Subnet95D7A6DB",
148 | },
149 | {
150 | "Ref": "DemoVpcPrivateSubnet1Subnet44F848DB",
151 | },
152 | {
153 | "Ref": "DemoVpcPrivateSubnet2Subnet2CBBAF70",
154 | },
155 | ],
156 | },
157 | "roleArn": {
158 | "Fn::GetAtt": [
159 | "DemoClusterRoleCBE40445",
160 | "Arn",
161 | ],
162 | },
163 | "version": "1.20",
164 | },
165 | "ServiceToken": {
166 | "Fn::GetAtt": [
167 | "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454",
168 | "Outputs.testawscdkawseksClusterResourceProviderframeworkonEvent05C9E6FDArn",
169 | ],
170 | },
171 | },
172 | "Type": "Custom::AWSCDK-EKS-Cluster",
173 | "UpdateReplacePolicy": "Delete",
174 | },
175 | "DemoClusterAwsAuthmanifest3A2B9945": {
176 | "DeletionPolicy": "Delete",
177 | "DependsOn": [
178 | "DemoClusterKubectlReadyBarrier6E436B52",
179 | ],
180 | "Properties": {
181 | "ClusterName": {
182 | "Ref": "DemoCluster38441829",
183 | },
184 | "Manifest": {
185 | "Fn::Join": [
186 | "",
187 | [
188 | "[{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"aws-auth","namespace":"kube-system","labels":{"aws.cdk.eks/prune-c8361663721d22f1f12c04c68f105b1a9f5aecea58":""}},"data":{"mapRoles":"[{\\"rolearn\\":\\"",
189 | {
190 | "Fn::GetAtt": [
191 | "DemoClusterMastersRoleAFB55B87",
192 | "Arn",
193 | ],
194 | },
195 | "\\",\\"username\\":\\"",
196 | {
197 | "Fn::GetAtt": [
198 | "DemoClusterMastersRoleAFB55B87",
199 | "Arn",
200 | ],
201 | },
202 | "\\",\\"groups\\":[\\"system:masters\\"]},{\\"rolearn\\":\\"",
203 | {
204 | "Fn::GetAtt": [
205 | "DemoClusterNodegroupDefaultCapacityNodeGroupRoleE7B25248",
206 | "Arn",
207 | ],
208 | },
209 | "\\",\\"username\\":\\"system:node:{{EC2PrivateDNSName}}\\",\\"groups\\":[\\"system:bootstrappers\\",\\"system:nodes\\"]},{\\"rolearn\\":\\"",
210 | {
211 | "Fn::GetAtt": [
212 | "DemoMyProjectRoleC858C671",
213 | "Arn",
214 | ],
215 | },
216 | "\\",\\"username\\":\\"",
217 | {
218 | "Fn::GetAtt": [
219 | "DemoMyProjectRoleC858C671",
220 | "Arn",
221 | ],
222 | },
223 | "\\",\\"groups\\":[\\"system:masters\\"]}]","mapUsers":"[]","mapAccounts":"[]"}}]",
224 | ],
225 | ],
226 | },
227 | "Overwrite": true,
228 | "PruneLabel": "aws.cdk.eks/prune-c8361663721d22f1f12c04c68f105b1a9f5aecea58",
229 | "RoleArn": {
230 | "Fn::GetAtt": [
231 | "DemoClusterCreationRole8978C51F",
232 | "Arn",
233 | ],
234 | },
235 | "ServiceToken": {
236 | "Fn::GetAtt": [
237 | "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B",
238 | "Outputs.testawscdkawseksKubectlProviderframeworkonEvent99848F43Arn",
239 | ],
240 | },
241 | },
242 | "Type": "Custom::AWSCDK-EKS-KubernetesResource",
243 | "UpdateReplacePolicy": "Delete",
244 | },
245 | "DemoClusterControlPlaneSecurityGroup6BA5AFA1": {
246 | "Properties": {
247 | "GroupDescription": "EKS Control Plane Security Group",
248 | "SecurityGroupEgress": [
249 | {
250 | "CidrIp": "0.0.0.0/0",
251 | "Description": "Allow all outbound traffic by default",
252 | "IpProtocol": "-1",
253 | },
254 | ],
255 | "VpcId": {
256 | "Ref": "DemoVpc45BBFD6B",
257 | },
258 | },
259 | "Type": "AWS::EC2::SecurityGroup",
260 | },
261 | "DemoClusterCreationRole8978C51F": {
262 | "DependsOn": [
263 | "DemoVpcIGW4CCD8DC2",
264 | "DemoVpcPrivateSubnet1DefaultRoute88DBC596",
265 | "DemoVpcPrivateSubnet1RouteTable0882FEB1",
266 | "DemoVpcPrivateSubnet1RouteTableAssociation810E5915",
267 | "DemoVpcPrivateSubnet1Subnet44F848DB",
268 | "DemoVpcPrivateSubnet2DefaultRouteCE36B950",
269 | "DemoVpcPrivateSubnet2RouteTable40B6F8E2",
270 | "DemoVpcPrivateSubnet2RouteTableAssociation625EC3BF",
271 | "DemoVpcPrivateSubnet2Subnet2CBBAF70",
272 | "DemoVpcPublicSubnet1DefaultRoute9F0A2508",
273 | "DemoVpcPublicSubnet1EIP504508F1",
274 | "DemoVpcPublicSubnet1NATGateway1792712A",
275 | "DemoVpcPublicSubnet1RouteTable7E6F7541",
276 | "DemoVpcPublicSubnet1RouteTableAssociationB6894BAD",
277 | "DemoVpcPublicSubnet1SubnetF3653284",
278 | "DemoVpcPublicSubnet2DefaultRoute61C7597A",
279 | "DemoVpcPublicSubnet2RouteTableCAAA2786",
280 | "DemoVpcPublicSubnet2RouteTableAssociation2BD8C06E",
281 | "DemoVpcPublicSubnet2Subnet95D7A6DB",
282 | "DemoVpc45BBFD6B",
283 | "DemoVpcVPCGWFC8D4299",
284 | ],
285 | "Properties": {
286 | "AssumeRolePolicyDocument": {
287 | "Statement": [
288 | {
289 | "Action": "sts:AssumeRole",
290 | "Effect": "Allow",
291 | "Principal": {
292 | "AWS": {
293 | "Fn::Join": [
294 | "",
295 | [
296 | "arn:",
297 | {
298 | "Ref": "AWS::Partition",
299 | },
300 | ":iam::",
301 | {
302 | "Ref": "AWS::AccountId",
303 | },
304 | ":root",
305 | ],
306 | ],
307 | },
308 | },
309 | },
310 | ],
311 | "Version": "2012-10-17",
312 | },
313 | },
314 | "Type": "AWS::IAM::Role",
315 | },
316 | "DemoClusterCreationRoleDefaultPolicy5FA9659F": {
317 | "DependsOn": [
318 | "DemoVpcIGW4CCD8DC2",
319 | "DemoVpcPrivateSubnet1DefaultRoute88DBC596",
320 | "DemoVpcPrivateSubnet1RouteTable0882FEB1",
321 | "DemoVpcPrivateSubnet1RouteTableAssociation810E5915",
322 | "DemoVpcPrivateSubnet1Subnet44F848DB",
323 | "DemoVpcPrivateSubnet2DefaultRouteCE36B950",
324 | "DemoVpcPrivateSubnet2RouteTable40B6F8E2",
325 | "DemoVpcPrivateSubnet2RouteTableAssociation625EC3BF",
326 | "DemoVpcPrivateSubnet2Subnet2CBBAF70",
327 | "DemoVpcPublicSubnet1DefaultRoute9F0A2508",
328 | "DemoVpcPublicSubnet1EIP504508F1",
329 | "DemoVpcPublicSubnet1NATGateway1792712A",
330 | "DemoVpcPublicSubnet1RouteTable7E6F7541",
331 | "DemoVpcPublicSubnet1RouteTableAssociationB6894BAD",
332 | "DemoVpcPublicSubnet1SubnetF3653284",
333 | "DemoVpcPublicSubnet2DefaultRoute61C7597A",
334 | "DemoVpcPublicSubnet2RouteTableCAAA2786",
335 | "DemoVpcPublicSubnet2RouteTableAssociation2BD8C06E",
336 | "DemoVpcPublicSubnet2Subnet95D7A6DB",
337 | "DemoVpc45BBFD6B",
338 | "DemoVpcVPCGWFC8D4299",
339 | ],
340 | "Properties": {
341 | "PolicyDocument": {
342 | "Statement": [
343 | {
344 | "Action": "iam:PassRole",
345 | "Effect": "Allow",
346 | "Resource": {
347 | "Fn::GetAtt": [
348 | "DemoClusterRoleCBE40445",
349 | "Arn",
350 | ],
351 | },
352 | },
353 | {
354 | "Action": [
355 | "eks:CreateCluster",
356 | "eks:DescribeCluster",
357 | "eks:DescribeUpdate",
358 | "eks:DeleteCluster",
359 | "eks:UpdateClusterVersion",
360 | "eks:UpdateClusterConfig",
361 | "eks:CreateFargateProfile",
362 | "eks:TagResource",
363 | "eks:UntagResource",
364 | ],
365 | "Effect": "Allow",
366 | "Resource": [
367 | "*",
368 | ],
369 | },
370 | {
371 | "Action": [
372 | "eks:DescribeFargateProfile",
373 | "eks:DeleteFargateProfile",
374 | ],
375 | "Effect": "Allow",
376 | "Resource": "*",
377 | },
378 | {
379 | "Action": [
380 | "iam:GetRole",
381 | "iam:listAttachedRolePolicies",
382 | ],
383 | "Effect": "Allow",
384 | "Resource": "*",
385 | },
386 | {
387 | "Action": "iam:CreateServiceLinkedRole",
388 | "Effect": "Allow",
389 | "Resource": "*",
390 | },
391 | {
392 | "Action": [
393 | "ec2:DescribeInstances",
394 | "ec2:DescribeNetworkInterfaces",
395 | "ec2:DescribeSecurityGroups",
396 | "ec2:DescribeSubnets",
397 | "ec2:DescribeRouteTables",
398 | "ec2:DescribeDhcpOptions",
399 | "ec2:DescribeVpcs",
400 | ],
401 | "Effect": "Allow",
402 | "Resource": "*",
403 | },
404 | ],
405 | "Version": "2012-10-17",
406 | },
407 | "PolicyName": "DemoClusterCreationRoleDefaultPolicy5FA9659F",
408 | "Roles": [
409 | {
410 | "Ref": "DemoClusterCreationRole8978C51F",
411 | },
412 | ],
413 | },
414 | "Type": "AWS::IAM::Policy",
415 | },
416 | "DemoClusterKubectlReadyBarrier6E436B52": {
417 | "DependsOn": [
418 | "DemoClusterCreationRoleDefaultPolicy5FA9659F",
419 | "DemoClusterCreationRole8978C51F",
420 | "DemoCluster38441829",
421 | ],
422 | "Properties": {
423 | "Type": "String",
424 | "Value": "aws:cdk:eks:kubectl-ready",
425 | },
426 | "Type": "AWS::SSM::Parameter",
427 | },
428 | "DemoClusterMastersRoleAFB55B87": {
429 | "Properties": {
430 | "AssumeRolePolicyDocument": {
431 | "Statement": [
432 | {
433 | "Action": "sts:AssumeRole",
434 | "Effect": "Allow",
435 | "Principal": {
436 | "AWS": {
437 | "Fn::Join": [
438 | "",
439 | [
440 | "arn:",
441 | {
442 | "Ref": "AWS::Partition",
443 | },
444 | ":iam::",
445 | {
446 | "Ref": "AWS::AccountId",
447 | },
448 | ":root",
449 | ],
450 | ],
451 | },
452 | },
453 | },
454 | ],
455 | "Version": "2012-10-17",
456 | },
457 | },
458 | "Type": "AWS::IAM::Role",
459 | },
460 | "DemoClusterNodegroupDefaultCapacity6094D612": {
461 | "Properties": {
462 | "AmiType": "AL2_x86_64",
463 | "ClusterName": {
464 | "Ref": "DemoCluster38441829",
465 | },
466 | "ForceUpdateEnabled": true,
467 | "InstanceTypes": [
468 | "m5.large",
469 | ],
470 | "NodeRole": {
471 | "Fn::GetAtt": [
472 | "DemoClusterNodegroupDefaultCapacityNodeGroupRoleE7B25248",
473 | "Arn",
474 | ],
475 | },
476 | "ScalingConfig": {
477 | "DesiredSize": 2,
478 | "MaxSize": 2,
479 | "MinSize": 2,
480 | },
481 | "Subnets": [
482 | {
483 | "Ref": "DemoVpcPrivateSubnet1Subnet44F848DB",
484 | },
485 | {
486 | "Ref": "DemoVpcPrivateSubnet2Subnet2CBBAF70",
487 | },
488 | ],
489 | },
490 | "Type": "AWS::EKS::Nodegroup",
491 | },
492 | "DemoClusterNodegroupDefaultCapacityNodeGroupRoleE7B25248": {
493 | "Properties": {
494 | "AssumeRolePolicyDocument": {
495 | "Statement": [
496 | {
497 | "Action": "sts:AssumeRole",
498 | "Effect": "Allow",
499 | "Principal": {
500 | "Service": {
501 | "Fn::Join": [
502 | "",
503 | [
504 | "ec2.",
505 | {
506 | "Ref": "AWS::URLSuffix",
507 | },
508 | ],
509 | ],
510 | },
511 | },
512 | },
513 | ],
514 | "Version": "2012-10-17",
515 | },
516 | "ManagedPolicyArns": [
517 | {
518 | "Fn::Join": [
519 | "",
520 | [
521 | "arn:",
522 | {
523 | "Ref": "AWS::Partition",
524 | },
525 | ":iam::aws:policy/AmazonEKSWorkerNodePolicy",
526 | ],
527 | ],
528 | },
529 | {
530 | "Fn::Join": [
531 | "",
532 | [
533 | "arn:",
534 | {
535 | "Ref": "AWS::Partition",
536 | },
537 | ":iam::aws:policy/AmazonEKS_CNI_Policy",
538 | ],
539 | ],
540 | },
541 | {
542 | "Fn::Join": [
543 | "",
544 | [
545 | "arn:",
546 | {
547 | "Ref": "AWS::Partition",
548 | },
549 | ":iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
550 | ],
551 | ],
552 | },
553 | ],
554 | },
555 | "Type": "AWS::IAM::Role",
556 | },
557 | "DemoClusterRoleCBE40445": {
558 | "Properties": {
559 | "AssumeRolePolicyDocument": {
560 | "Statement": [
561 | {
562 | "Action": "sts:AssumeRole",
563 | "Effect": "Allow",
564 | "Principal": {
565 | "Service": "eks.amazonaws.com",
566 | },
567 | },
568 | ],
569 | "Version": "2012-10-17",
570 | },
571 | "ManagedPolicyArns": [
572 | {
573 | "Fn::Join": [
574 | "",
575 | [
576 | "arn:",
577 | {
578 | "Ref": "AWS::Partition",
579 | },
580 | ":iam::aws:policy/AmazonEKSClusterPolicy",
581 | ],
582 | ],
583 | },
584 | ],
585 | },
586 | "Type": "AWS::IAM::Role",
587 | },
588 | "DemoCodeCommitRepo0DD21DC2": {
589 | "Properties": {
590 | "RepositoryName": "test-repo",
591 | },
592 | "Type": "AWS::CodeCommit::Repository",
593 | },
594 | "DemoCodeCommitRepoOnCommitD69605C8": {
595 | "Properties": {
596 | "EventPattern": {
597 | "detail": {
598 | "event": [
599 | "referenceCreated",
600 | "referenceUpdated",
601 | ],
602 | },
603 | "detail-type": [
604 | "CodeCommit Repository State Change",
605 | ],
606 | "resources": [
607 | {
608 | "Fn::GetAtt": [
609 | "DemoCodeCommitRepo0DD21DC2",
610 | "Arn",
611 | ],
612 | },
613 | ],
614 | "source": [
615 | "aws.codecommit",
616 | ],
617 | },
618 | "State": "ENABLED",
619 | "Targets": [
620 | {
621 | "Arn": {
622 | "Fn::GetAtt": [
623 | "DemoMyProject9BD63FB6",
624 | "Arn",
625 | ],
626 | },
627 | "Id": "Target0",
628 | "RoleArn": {
629 | "Fn::GetAtt": [
630 | "DemoMyProjectEventsRole4995FFE7",
631 | "Arn",
632 | ],
633 | },
634 | },
635 | ],
636 | },
637 | "Type": "AWS::Events::Rule",
638 | },
639 | "DemoEcrRepo2DA11D32": {
640 | "DeletionPolicy": "Retain",
641 | "Type": "AWS::ECR::Repository",
642 | "UpdateReplacePolicy": "Retain",
643 | },
644 | "DemoMyProject9BD63FB6": {
645 | "Properties": {
646 | "Artifacts": {
647 | "Type": "NO_ARTIFACTS",
648 | },
649 | "Cache": {
650 | "Type": "NO_CACHE",
651 | },
652 | "EncryptionKey": "alias/aws/s3",
653 | "Environment": {
654 | "ComputeType": "BUILD_GENERAL1_SMALL",
655 | "EnvironmentVariables": [
656 | {
657 | "Name": "CLUSTER_NAME",
658 | "Type": "PLAINTEXT",
659 | "Value": {
660 | "Ref": "DemoCluster38441829",
661 | },
662 | },
663 | {
664 | "Name": "ECR_REPO_URI",
665 | "Type": "PLAINTEXT",
666 | "Value": {
667 | "Fn::Join": [
668 | "",
669 | [
670 | {
671 | "Fn::Select": [
672 | 4,
673 | {
674 | "Fn::Split": [
675 | ":",
676 | {
677 | "Fn::GetAtt": [
678 | "DemoEcrRepo2DA11D32",
679 | "Arn",
680 | ],
681 | },
682 | ],
683 | },
684 | ],
685 | },
686 | ".dkr.ecr.",
687 | {
688 | "Fn::Select": [
689 | 3,
690 | {
691 | "Fn::Split": [
692 | ":",
693 | {
694 | "Fn::GetAtt": [
695 | "DemoEcrRepo2DA11D32",
696 | "Arn",
697 | ],
698 | },
699 | ],
700 | },
701 | ],
702 | },
703 | ".",
704 | {
705 | "Ref": "AWS::URLSuffix",
706 | },
707 | "/",
708 | {
709 | "Ref": "DemoEcrRepo2DA11D32",
710 | },
711 | ],
712 | ],
713 | },
714 | },
715 | ],
716 | "Image": {
717 | "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:8d51351cd3070bbd026f269fb20440c029ef75acb4a5c07f148135f707510426",
718 | },
719 | "ImagePullCredentialsType": "SERVICE_ROLE",
720 | "PrivilegedMode": true,
721 | "Type": "LINUX_CONTAINER",
722 | },
723 | "Name": "test",
724 | "ServiceRole": {
725 | "Fn::GetAtt": [
726 | "DemoMyProjectRoleC858C671",
727 | "Arn",
728 | ],
729 | },
730 | "Source": {
731 | "BuildSpec": "{
732 | "version": "0.2",
733 | "phases": {
734 | "pre_build": {
735 | "commands": [
736 | "env",
737 | "export TAG=\${CODEBUILD_RESOLVED_SOURCE_VERSION}",
738 | "export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output=text)",
739 | "/usr/local/bin/entrypoint.sh",
740 | "echo Logging in to Amazon ECR",
741 | "aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"
742 | ]
743 | },
744 | "build": {
745 | "commands": [
746 | "cd flask-docker-app",
747 | "docker build -t $ECR_REPO_URI:$TAG .",
748 | "docker push $ECR_REPO_URI:$TAG"
749 | ]
750 | },
751 | "post_build": {
752 | "commands": [
753 | "kubectl get no",
754 | "kubectl set image deployment flask-deployment flask=$ECR_REPO_URI:$TAG"
755 | ]
756 | }
757 | }
758 | }",
759 | "Location": {
760 | "Fn::GetAtt": [
761 | "DemoCodeCommitRepo0DD21DC2",
762 | "CloneUrlHttp",
763 | ],
764 | },
765 | "Type": "CODECOMMIT",
766 | },
767 | },
768 | "Type": "AWS::CodeBuild::Project",
769 | },
770 | "DemoMyProjectEventsRole4995FFE7": {
771 | "Properties": {
772 | "AssumeRolePolicyDocument": {
773 | "Statement": [
774 | {
775 | "Action": "sts:AssumeRole",
776 | "Effect": "Allow",
777 | "Principal": {
778 | "Service": "events.amazonaws.com",
779 | },
780 | },
781 | ],
782 | "Version": "2012-10-17",
783 | },
784 | },
785 | "Type": "AWS::IAM::Role",
786 | },
787 | "DemoMyProjectEventsRoleDefaultPolicyE280CB8C": {
788 | "Properties": {
789 | "PolicyDocument": {
790 | "Statement": [
791 | {
792 | "Action": "codebuild:StartBuild",
793 | "Effect": "Allow",
794 | "Resource": {
795 | "Fn::GetAtt": [
796 | "DemoMyProject9BD63FB6",
797 | "Arn",
798 | ],
799 | },
800 | },
801 | ],
802 | "Version": "2012-10-17",
803 | },
804 | "PolicyName": "DemoMyProjectEventsRoleDefaultPolicyE280CB8C",
805 | "Roles": [
806 | {
807 | "Ref": "DemoMyProjectEventsRole4995FFE7",
808 | },
809 | ],
810 | },
811 | "Type": "AWS::IAM::Policy",
812 | },
813 | "DemoMyProjectRoleC858C671": {
814 | "Properties": {
815 | "AssumeRolePolicyDocument": {
816 | "Statement": [
817 | {
818 | "Action": "sts:AssumeRole",
819 | "Effect": "Allow",
820 | "Principal": {
821 | "Service": "codebuild.amazonaws.com",
822 | },
823 | },
824 | ],
825 | "Version": "2012-10-17",
826 | },
827 | },
828 | "Type": "AWS::IAM::Role",
829 | },
830 | "DemoMyProjectRoleDefaultPolicyFF36F40B": {
831 | "Properties": {
832 | "PolicyDocument": {
833 | "Statement": [
834 | {
835 | "Action": "codecommit:GitPull",
836 | "Effect": "Allow",
837 | "Resource": {
838 | "Fn::GetAtt": [
839 | "DemoCodeCommitRepo0DD21DC2",
840 | "Arn",
841 | ],
842 | },
843 | },
844 | {
845 | "Action": [
846 | "ecr:BatchCheckLayerAvailability",
847 | "ecr:GetDownloadUrlForLayer",
848 | "ecr:BatchGetImage",
849 | ],
850 | "Effect": "Allow",
851 | "Resource": {
852 | "Fn::Join": [
853 | "",
854 | [
855 | "arn:",
856 | {
857 | "Ref": "AWS::Partition",
858 | },
859 | ":ecr:",
860 | {
861 | "Ref": "AWS::Region",
862 | },
863 | ":",
864 | {
865 | "Ref": "AWS::AccountId",
866 | },
867 | ":repository/",
868 | {
869 | "Fn::Sub": "cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}",
870 | },
871 | ],
872 | ],
873 | },
874 | },
875 | {
876 | "Action": "ecr:GetAuthorizationToken",
877 | "Effect": "Allow",
878 | "Resource": "*",
879 | },
880 | {
881 | "Action": [
882 | "logs:CreateLogGroup",
883 | "logs:CreateLogStream",
884 | "logs:PutLogEvents",
885 | ],
886 | "Effect": "Allow",
887 | "Resource": [
888 | {
889 | "Fn::Join": [
890 | "",
891 | [
892 | "arn:",
893 | {
894 | "Ref": "AWS::Partition",
895 | },
896 | ":logs:",
897 | {
898 | "Ref": "AWS::Region",
899 | },
900 | ":",
901 | {
902 | "Ref": "AWS::AccountId",
903 | },
904 | ":log-group:/aws/codebuild/",
905 | {
906 | "Ref": "DemoMyProject9BD63FB6",
907 | },
908 | ],
909 | ],
910 | },
911 | {
912 | "Fn::Join": [
913 | "",
914 | [
915 | "arn:",
916 | {
917 | "Ref": "AWS::Partition",
918 | },
919 | ":logs:",
920 | {
921 | "Ref": "AWS::Region",
922 | },
923 | ":",
924 | {
925 | "Ref": "AWS::AccountId",
926 | },
927 | ":log-group:/aws/codebuild/",
928 | {
929 | "Ref": "DemoMyProject9BD63FB6",
930 | },
931 | ":*",
932 | ],
933 | ],
934 | },
935 | ],
936 | },
937 | {
938 | "Action": [
939 | "codebuild:CreateReportGroup",
940 | "codebuild:CreateReport",
941 | "codebuild:UpdateReport",
942 | "codebuild:BatchPutTestCases",
943 | "codebuild:BatchPutCodeCoverages",
944 | ],
945 | "Effect": "Allow",
946 | "Resource": {
947 | "Fn::Join": [
948 | "",
949 | [
950 | "arn:",
951 | {
952 | "Ref": "AWS::Partition",
953 | },
954 | ":codebuild:",
955 | {
956 | "Ref": "AWS::Region",
957 | },
958 | ":",
959 | {
960 | "Ref": "AWS::AccountId",
961 | },
962 | ":report-group/",
963 | {
964 | "Ref": "DemoMyProject9BD63FB6",
965 | },
966 | "-*",
967 | ],
968 | ],
969 | },
970 | },
971 | {
972 | "Action": [
973 | "ecr:BatchCheckLayerAvailability",
974 | "ecr:GetDownloadUrlForLayer",
975 | "ecr:BatchGetImage",
976 | ],
977 | "Effect": "Allow",
978 | "Resource": {
979 | "Fn::GetAtt": [
980 | "DemoEcrRepo2DA11D32",
981 | "Arn",
982 | ],
983 | },
984 | },
985 | {
986 | "Action": [
987 | "ecr:PutImage",
988 | "ecr:InitiateLayerUpload",
989 | "ecr:UploadLayerPart",
990 | "ecr:CompleteLayerUpload",
991 | ],
992 | "Effect": "Allow",
993 | "Resource": {
994 | "Fn::GetAtt": [
995 | "DemoEcrRepo2DA11D32",
996 | "Arn",
997 | ],
998 | },
999 | },
1000 | {
1001 | "Action": "eks:DescribeCluster",
1002 | "Effect": "Allow",
1003 | "Resource": {
1004 | "Fn::GetAtt": [
1005 | "DemoCluster38441829",
1006 | "Arn",
1007 | ],
1008 | },
1009 | },
1010 | ],
1011 | "Version": "2012-10-17",
1012 | },
1013 | "PolicyName": "DemoMyProjectRoleDefaultPolicyFF36F40B",
1014 | "Roles": [
1015 | {
1016 | "Ref": "DemoMyProjectRoleC858C671",
1017 | },
1018 | ],
1019 | },
1020 | "Type": "AWS::IAM::Policy",
1021 | },
1022 | "DemoVpc45BBFD6B": {
1023 | "Properties": {
1024 | "CidrBlock": "10.0.0.0/16",
1025 | "EnableDnsHostnames": true,
1026 | "EnableDnsSupport": true,
1027 | "InstanceTenancy": "default",
1028 | "Tags": [
1029 | {
1030 | "Key": "Name",
1031 | "Value": "test/Demo/Vpc",
1032 | },
1033 | ],
1034 | },
1035 | "Type": "AWS::EC2::VPC",
1036 | },
1037 | "DemoVpcIGW4CCD8DC2": {
1038 | "Properties": {
1039 | "Tags": [
1040 | {
1041 | "Key": "Name",
1042 | "Value": "test/Demo/Vpc",
1043 | },
1044 | ],
1045 | },
1046 | "Type": "AWS::EC2::InternetGateway",
1047 | },
1048 | "DemoVpcPrivateSubnet1DefaultRoute88DBC596": {
1049 | "Properties": {
1050 | "DestinationCidrBlock": "0.0.0.0/0",
1051 | "NatGatewayId": {
1052 | "Ref": "DemoVpcPublicSubnet1NATGateway1792712A",
1053 | },
1054 | "RouteTableId": {
1055 | "Ref": "DemoVpcPrivateSubnet1RouteTable0882FEB1",
1056 | },
1057 | },
1058 | "Type": "AWS::EC2::Route",
1059 | },
1060 | "DemoVpcPrivateSubnet1RouteTable0882FEB1": {
1061 | "Properties": {
1062 | "Tags": [
1063 | {
1064 | "Key": "kubernetes.io/role/internal-elb",
1065 | "Value": "1",
1066 | },
1067 | {
1068 | "Key": "Name",
1069 | "Value": "test/Demo/Vpc/PrivateSubnet1",
1070 | },
1071 | ],
1072 | "VpcId": {
1073 | "Ref": "DemoVpc45BBFD6B",
1074 | },
1075 | },
1076 | "Type": "AWS::EC2::RouteTable",
1077 | },
1078 | "DemoVpcPrivateSubnet1RouteTableAssociation810E5915": {
1079 | "Properties": {
1080 | "RouteTableId": {
1081 | "Ref": "DemoVpcPrivateSubnet1RouteTable0882FEB1",
1082 | },
1083 | "SubnetId": {
1084 | "Ref": "DemoVpcPrivateSubnet1Subnet44F848DB",
1085 | },
1086 | },
1087 | "Type": "AWS::EC2::SubnetRouteTableAssociation",
1088 | },
1089 | "DemoVpcPrivateSubnet1Subnet44F848DB": {
1090 | "Properties": {
1091 | "AvailabilityZone": {
1092 | "Fn::Select": [
1093 | 0,
1094 | {
1095 | "Fn::GetAZs": "",
1096 | },
1097 | ],
1098 | },
1099 | "CidrBlock": "10.0.128.0/18",
1100 | "MapPublicIpOnLaunch": false,
1101 | "Tags": [
1102 | {
1103 | "Key": "aws-cdk:subnet-name",
1104 | "Value": "Private",
1105 | },
1106 | {
1107 | "Key": "aws-cdk:subnet-type",
1108 | "Value": "Private",
1109 | },
1110 | {
1111 | "Key": "kubernetes.io/role/internal-elb",
1112 | "Value": "1",
1113 | },
1114 | {
1115 | "Key": "Name",
1116 | "Value": "test/Demo/Vpc/PrivateSubnet1",
1117 | },
1118 | ],
1119 | "VpcId": {
1120 | "Ref": "DemoVpc45BBFD6B",
1121 | },
1122 | },
1123 | "Type": "AWS::EC2::Subnet",
1124 | },
1125 | "DemoVpcPrivateSubnet2DefaultRouteCE36B950": {
1126 | "Properties": {
1127 | "DestinationCidrBlock": "0.0.0.0/0",
1128 | "NatGatewayId": {
1129 | "Ref": "DemoVpcPublicSubnet1NATGateway1792712A",
1130 | },
1131 | "RouteTableId": {
1132 | "Ref": "DemoVpcPrivateSubnet2RouteTable40B6F8E2",
1133 | },
1134 | },
1135 | "Type": "AWS::EC2::Route",
1136 | },
1137 | "DemoVpcPrivateSubnet2RouteTable40B6F8E2": {
1138 | "Properties": {
1139 | "Tags": [
1140 | {
1141 | "Key": "kubernetes.io/role/internal-elb",
1142 | "Value": "1",
1143 | },
1144 | {
1145 | "Key": "Name",
1146 | "Value": "test/Demo/Vpc/PrivateSubnet2",
1147 | },
1148 | ],
1149 | "VpcId": {
1150 | "Ref": "DemoVpc45BBFD6B",
1151 | },
1152 | },
1153 | "Type": "AWS::EC2::RouteTable",
1154 | },
1155 | "DemoVpcPrivateSubnet2RouteTableAssociation625EC3BF": {
1156 | "Properties": {
1157 | "RouteTableId": {
1158 | "Ref": "DemoVpcPrivateSubnet2RouteTable40B6F8E2",
1159 | },
1160 | "SubnetId": {
1161 | "Ref": "DemoVpcPrivateSubnet2Subnet2CBBAF70",
1162 | },
1163 | },
1164 | "Type": "AWS::EC2::SubnetRouteTableAssociation",
1165 | },
1166 | "DemoVpcPrivateSubnet2Subnet2CBBAF70": {
1167 | "Properties": {
1168 | "AvailabilityZone": {
1169 | "Fn::Select": [
1170 | 1,
1171 | {
1172 | "Fn::GetAZs": "",
1173 | },
1174 | ],
1175 | },
1176 | "CidrBlock": "10.0.192.0/18",
1177 | "MapPublicIpOnLaunch": false,
1178 | "Tags": [
1179 | {
1180 | "Key": "aws-cdk:subnet-name",
1181 | "Value": "Private",
1182 | },
1183 | {
1184 | "Key": "aws-cdk:subnet-type",
1185 | "Value": "Private",
1186 | },
1187 | {
1188 | "Key": "kubernetes.io/role/internal-elb",
1189 | "Value": "1",
1190 | },
1191 | {
1192 | "Key": "Name",
1193 | "Value": "test/Demo/Vpc/PrivateSubnet2",
1194 | },
1195 | ],
1196 | "VpcId": {
1197 | "Ref": "DemoVpc45BBFD6B",
1198 | },
1199 | },
1200 | "Type": "AWS::EC2::Subnet",
1201 | },
1202 | "DemoVpcPublicSubnet1DefaultRoute9F0A2508": {
1203 | "DependsOn": [
1204 | "DemoVpcVPCGWFC8D4299",
1205 | ],
1206 | "Properties": {
1207 | "DestinationCidrBlock": "0.0.0.0/0",
1208 | "GatewayId": {
1209 | "Ref": "DemoVpcIGW4CCD8DC2",
1210 | },
1211 | "RouteTableId": {
1212 | "Ref": "DemoVpcPublicSubnet1RouteTable7E6F7541",
1213 | },
1214 | },
1215 | "Type": "AWS::EC2::Route",
1216 | },
1217 | "DemoVpcPublicSubnet1EIP504508F1": {
1218 | "Properties": {
1219 | "Domain": "vpc",
1220 | "Tags": [
1221 | {
1222 | "Key": "kubernetes.io/role/elb",
1223 | "Value": "1",
1224 | },
1225 | {
1226 | "Key": "Name",
1227 | "Value": "test/Demo/Vpc/PublicSubnet1",
1228 | },
1229 | ],
1230 | },
1231 | "Type": "AWS::EC2::EIP",
1232 | },
1233 | "DemoVpcPublicSubnet1NATGateway1792712A": {
1234 | "DependsOn": [
1235 | "DemoVpcPublicSubnet1DefaultRoute9F0A2508",
1236 | "DemoVpcPublicSubnet1RouteTableAssociationB6894BAD",
1237 | ],
1238 | "Properties": {
1239 | "AllocationId": {
1240 | "Fn::GetAtt": [
1241 | "DemoVpcPublicSubnet1EIP504508F1",
1242 | "AllocationId",
1243 | ],
1244 | },
1245 | "SubnetId": {
1246 | "Ref": "DemoVpcPublicSubnet1SubnetF3653284",
1247 | },
1248 | "Tags": [
1249 | {
1250 | "Key": "kubernetes.io/role/elb",
1251 | "Value": "1",
1252 | },
1253 | {
1254 | "Key": "Name",
1255 | "Value": "test/Demo/Vpc/PublicSubnet1",
1256 | },
1257 | ],
1258 | },
1259 | "Type": "AWS::EC2::NatGateway",
1260 | },
1261 | "DemoVpcPublicSubnet1RouteTable7E6F7541": {
1262 | "Properties": {
1263 | "Tags": [
1264 | {
1265 | "Key": "kubernetes.io/role/elb",
1266 | "Value": "1",
1267 | },
1268 | {
1269 | "Key": "Name",
1270 | "Value": "test/Demo/Vpc/PublicSubnet1",
1271 | },
1272 | ],
1273 | "VpcId": {
1274 | "Ref": "DemoVpc45BBFD6B",
1275 | },
1276 | },
1277 | "Type": "AWS::EC2::RouteTable",
1278 | },
1279 | "DemoVpcPublicSubnet1RouteTableAssociationB6894BAD": {
1280 | "Properties": {
1281 | "RouteTableId": {
1282 | "Ref": "DemoVpcPublicSubnet1RouteTable7E6F7541",
1283 | },
1284 | "SubnetId": {
1285 | "Ref": "DemoVpcPublicSubnet1SubnetF3653284",
1286 | },
1287 | },
1288 | "Type": "AWS::EC2::SubnetRouteTableAssociation",
1289 | },
1290 | "DemoVpcPublicSubnet1SubnetF3653284": {
1291 | "Properties": {
1292 | "AvailabilityZone": {
1293 | "Fn::Select": [
1294 | 0,
1295 | {
1296 | "Fn::GetAZs": "",
1297 | },
1298 | ],
1299 | },
1300 | "CidrBlock": "10.0.0.0/18",
1301 | "MapPublicIpOnLaunch": true,
1302 | "Tags": [
1303 | {
1304 | "Key": "aws-cdk:subnet-name",
1305 | "Value": "Public",
1306 | },
1307 | {
1308 | "Key": "aws-cdk:subnet-type",
1309 | "Value": "Public",
1310 | },
1311 | {
1312 | "Key": "kubernetes.io/role/elb",
1313 | "Value": "1",
1314 | },
1315 | {
1316 | "Key": "Name",
1317 | "Value": "test/Demo/Vpc/PublicSubnet1",
1318 | },
1319 | ],
1320 | "VpcId": {
1321 | "Ref": "DemoVpc45BBFD6B",
1322 | },
1323 | },
1324 | "Type": "AWS::EC2::Subnet",
1325 | },
1326 | "DemoVpcPublicSubnet2DefaultRoute61C7597A": {
1327 | "DependsOn": [
1328 | "DemoVpcVPCGWFC8D4299",
1329 | ],
1330 | "Properties": {
1331 | "DestinationCidrBlock": "0.0.0.0/0",
1332 | "GatewayId": {
1333 | "Ref": "DemoVpcIGW4CCD8DC2",
1334 | },
1335 | "RouteTableId": {
1336 | "Ref": "DemoVpcPublicSubnet2RouteTableCAAA2786",
1337 | },
1338 | },
1339 | "Type": "AWS::EC2::Route",
1340 | },
1341 | "DemoVpcPublicSubnet2RouteTableAssociation2BD8C06E": {
1342 | "Properties": {
1343 | "RouteTableId": {
1344 | "Ref": "DemoVpcPublicSubnet2RouteTableCAAA2786",
1345 | },
1346 | "SubnetId": {
1347 | "Ref": "DemoVpcPublicSubnet2Subnet95D7A6DB",
1348 | },
1349 | },
1350 | "Type": "AWS::EC2::SubnetRouteTableAssociation",
1351 | },
1352 | "DemoVpcPublicSubnet2RouteTableCAAA2786": {
1353 | "Properties": {
1354 | "Tags": [
1355 | {
1356 | "Key": "kubernetes.io/role/elb",
1357 | "Value": "1",
1358 | },
1359 | {
1360 | "Key": "Name",
1361 | "Value": "test/Demo/Vpc/PublicSubnet2",
1362 | },
1363 | ],
1364 | "VpcId": {
1365 | "Ref": "DemoVpc45BBFD6B",
1366 | },
1367 | },
1368 | "Type": "AWS::EC2::RouteTable",
1369 | },
1370 | "DemoVpcPublicSubnet2Subnet95D7A6DB": {
1371 | "Properties": {
1372 | "AvailabilityZone": {
1373 | "Fn::Select": [
1374 | 1,
1375 | {
1376 | "Fn::GetAZs": "",
1377 | },
1378 | ],
1379 | },
1380 | "CidrBlock": "10.0.64.0/18",
1381 | "MapPublicIpOnLaunch": true,
1382 | "Tags": [
1383 | {
1384 | "Key": "aws-cdk:subnet-name",
1385 | "Value": "Public",
1386 | },
1387 | {
1388 | "Key": "aws-cdk:subnet-type",
1389 | "Value": "Public",
1390 | },
1391 | {
1392 | "Key": "kubernetes.io/role/elb",
1393 | "Value": "1",
1394 | },
1395 | {
1396 | "Key": "Name",
1397 | "Value": "test/Demo/Vpc/PublicSubnet2",
1398 | },
1399 | ],
1400 | "VpcId": {
1401 | "Ref": "DemoVpc45BBFD6B",
1402 | },
1403 | },
1404 | "Type": "AWS::EC2::Subnet",
1405 | },
1406 | "DemoVpcVPCGWFC8D4299": {
1407 | "Properties": {
1408 | "InternetGatewayId": {
1409 | "Ref": "DemoVpcIGW4CCD8DC2",
1410 | },
1411 | "VpcId": {
1412 | "Ref": "DemoVpc45BBFD6B",
1413 | },
1414 | },
1415 | "Type": "AWS::EC2::VPCGatewayAttachment",
1416 | },
1417 | "awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454": {
1418 | "DeletionPolicy": "Delete",
1419 | "Properties": {
1420 | "Parameters": {
1421 | "referencetotestDemoClusterCreationRole0D51DF83Arn": {
1422 | "Fn::GetAtt": [
1423 | "DemoClusterCreationRole8978C51F",
1424 | "Arn",
1425 | ],
1426 | },
1427 | },
1428 | "TemplateURL": {
1429 | "Fn::Join": [
1430 | "",
1431 | [
1432 | "https://s3.",
1433 | {
1434 | "Ref": "AWS::Region",
1435 | },
1436 | ".",
1437 | {
1438 | "Ref": "AWS::URLSuffix",
1439 | },
1440 | "/",
1441 | {
1442 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
1443 | },
1444 | "/f50c5d2b9dfc9b2af4efa1ae4a43b450748c8472acc82f930129c826f51cf13b.json",
1445 | ],
1446 | ],
1447 | },
1448 | },
1449 | "Type": "AWS::CloudFormation::Stack",
1450 | "UpdateReplacePolicy": "Delete",
1451 | },
1452 | "awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B": {
1453 | "DeletionPolicy": "Delete",
1454 | "DependsOn": [
1455 | "DemoVpcPrivateSubnet1DefaultRoute88DBC596",
1456 | "DemoVpcPrivateSubnet1RouteTableAssociation810E5915",
1457 | "DemoVpcPrivateSubnet2DefaultRouteCE36B950",
1458 | "DemoVpcPrivateSubnet2RouteTableAssociation625EC3BF",
1459 | ],
1460 | "Properties": {
1461 | "Parameters": {
1462 | "referencetotestDemoClusterCreationRole0D51DF83Arn": {
1463 | "Fn::GetAtt": [
1464 | "DemoClusterCreationRole8978C51F",
1465 | "Arn",
1466 | ],
1467 | },
1468 | "referencetotestDemoClusterF24AB9FFArn": {
1469 | "Fn::GetAtt": [
1470 | "DemoCluster38441829",
1471 | "Arn",
1472 | ],
1473 | },
1474 | "referencetotestDemoClusterF24AB9FFClusterSecurityGroupId": {
1475 | "Fn::GetAtt": [
1476 | "DemoCluster38441829",
1477 | "ClusterSecurityGroupId",
1478 | ],
1479 | },
1480 | "referencetotestDemoVpcPrivateSubnet1SubnetE9725D30Ref": {
1481 | "Ref": "DemoVpcPrivateSubnet1Subnet44F848DB",
1482 | },
1483 | "referencetotestDemoVpcPrivateSubnet2Subnet0F383055Ref": {
1484 | "Ref": "DemoVpcPrivateSubnet2Subnet2CBBAF70",
1485 | },
1486 | },
1487 | "TemplateURL": {
1488 | "Fn::Join": [
1489 | "",
1490 | [
1491 | "https://s3.",
1492 | {
1493 | "Ref": "AWS::Region",
1494 | },
1495 | ".",
1496 | {
1497 | "Ref": "AWS::URLSuffix",
1498 | },
1499 | "/",
1500 | {
1501 | "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
1502 | },
1503 | "/80184505f268c13403f7adff072c3f1fef2c65587cd6c8f13bd844d20d5dd7a3.json",
1504 | ],
1505 | ],
1506 | },
1507 | },
1508 | "Type": "AWS::CloudFormation::Stack",
1509 | "UpdateReplacePolicy": "Delete",
1510 | },
1511 | },
1512 | "Rules": {
1513 | "CheckBootstrapVersion": {
1514 | "Assertions": [
1515 | {
1516 | "Assert": {
1517 | "Fn::Not": [
1518 | {
1519 | "Fn::Contains": [
1520 | [
1521 | "1",
1522 | "2",
1523 | "3",
1524 | "4",
1525 | "5",
1526 | ],
1527 | {
1528 | "Ref": "BootstrapVersion",
1529 | },
1530 | ],
1531 | },
1532 | ],
1533 | },
1534 | "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.",
1535 | },
1536 | ],
1537 | },
1538 | },
1539 | }
1540 | `;
1541 |
--------------------------------------------------------------------------------