├── 100 ├── fa-100-sns.yaml └── README.md ├── 101 ├── fa-101-s3-02.yaml └── fa-101-sns.yaml ├── 102 ├── fa-102-sns.yaml └── fa-102-eventbridge.yaml ├── 103 ├── fa-103-s3-02.yaml ├── fa-103-sns.yaml └── fa-103-config.yaml ├── 104 ├── fa-104-s3-02.yaml └── fa-104-sns.yaml ├── 105 ├── fa-105-customresource.yaml ├── music.json └── fa-105-dynamodb.yaml ├── 106 └── fa-106-s3.yaml ├── 107 ├── fa-107-dynamodb.yaml └── README.md ├── 108 ├── fa-108-s3.yaml ├── fa-108.yaml └── README.md ├── 109 ├── fa-109-s3.yaml ├── fa-109.yaml └── README.md ├── 110 └── README.md ├── 111 └── README.md ├── 112 └── README.md ├── 113 ├── fa-113-s3.yaml ├── fa-113-eventbridge.yaml └── fa-113-sns.yaml ├── 114 ├── fa-114-sqs.yaml └── README.md ├── 116 └── fa-116-s3.yaml ├── 117 ├── sample-template │ ├── prod-stack-configuration.json │ └── test-stack-configuration.json ├── fa-117-s3.yaml └── fa-117-sns.yaml ├── 118 ├── fa-118-ssm-iam.yaml └── fa-118-ssm-01.yaml ├── 121 └── README.md ├── 123 └── fa-123-eventbridge.yaml ├── 125 ├── fa-125-s3-01.yaml └── fa-125-s3-02.yaml ├── 126 └── fa-126-secretsmanager.yaml ├── 127 ├── fa-127-ecr.yaml └── fa-127-secretsmanager.yaml ├── 129 ├── fa-129-ecr.yaml └── fa-129-secretsmanager.yaml ├── 130 └── fa-130-ssm.yaml ├── 131 ├── fa-131.yaml └── README.md ├── 132 ├── fa-132-endpoint.yaml └── README.md ├── 133 ├── fa-133-code.yaml └── README.md ├── 134 ├── fa-134-s3-01.yaml ├── fa-134-acm.yaml ├── fa-134-route53.yaml └── fa-134-s3-02.yaml ├── 135 ├── fa-135.yaml └── README.md ├── 136 ├── fa-136-s3.yaml └── README.md ├── 137 ├── .taskcat.yml ├── fa-137-s3.yaml └── fa-137-sns.yaml ├── 138 └── README.md ├── 139 └── fa-139-endpoint.yaml ├── 141 └── fa-141-s3.yaml ├── 142 └── fa-142-s3.yaml ├── 143 └── fa-143-s3.yaml ├── 144 └── fa-144-route53.yaml ├── 145 └── fa-145-ec2.yaml ├── 146 ├── fa-146-organizations.yaml └── fa-146.yaml ├── 147 └── fa-147-ssm.yaml ├── 148 └── fa-148-ssm.yaml ├── 149 ├── fa-149-s3.yaml └── README.md ├── 150 ├── fa-150-s3.yaml └── README.md ├── 151 └── README.md ├── 152 ├── fa-152-02-ssm.yaml ├── fa-152-02.yaml └── fa-152-01-iam.yaml ├── 153 ├── fa-153-01-s3.yaml └── fa-153-02-iot-02.yaml ├── 154 ├── fa-154-s3.yaml └── fa-154-iot-02.yaml ├── 155 ├── fa-155-01-s3.yaml └── fa-155-02-iot-02.yaml ├── 156 ├── fa-156-01-s3.yaml └── fa-156-02-iot-02.yaml ├── 157 ├── fa-157-01-s3.yaml ├── fa-157-02-iot-02.yaml └── fa-157-02-iot-01.yaml ├── 158 ├── fa-158.yaml └── README.md ├── 159 └── fa-159-sns.yaml ├── 160 ├── fa-160-sns.yaml └── README.md ├── 161 ├── fa-161-dynamodb.yaml └── README.md ├── 162 └── fa-162-sns.yaml ├── 163 ├── fa-163-01-s3.yaml └── fa-163-02-iot-02.yaml ├── 164 ├── fa-164-01-s3.yaml ├── fa-164-02-iot-02.yaml └── fa-164-02-dynamodb.yaml ├── 165 └── fa-165-iot.yaml ├── 167 ├── fa-167-s3.yaml └── fa-167-iot-02.yaml ├── 168 └── fa-168-iot.yaml ├── 040 └── python │ └── mylayer │ ├── __init__.py │ └── mylayer.py ├── 082 ├── Dockerfile ├── fa-082.yaml └── README.md ├── 083 ├── Dockerfile ├── fa-083.yaml └── README.md ├── 018 ├── task2 │ ├── Dockerfile │ └── index.html └── fa-018-ecr.yaml ├── 068 ├── task2 │ ├── Dockerfile │ └── index.html └── fa-068-ecr.yaml ├── 086 └── container │ ├── Dockerfile │ └── index.html ├── 011 └── html │ ├── error.html │ └── index.html ├── 019 ├── container │ ├── Dockerfile │ └── index.html ├── fa-019-ecr.yaml └── fa-019-fargate.yaml ├── 012 ├── html │ ├── signout.html │ ├── signin.html │ └── index.html ├── webpack.config.js └── cfn-templates │ ├── fa-012-ssm.yaml │ └── fa-012-s3.yaml ├── 035 ├── html │ ├── signout.html │ ├── signin.html │ └── index.html ├── webpack.config.js ├── cfn-templates │ ├── fa-035-ssm.yaml │ └── fa-035-s3.yaml └── package.json ├── 036 ├── html │ ├── signout.html │ ├── signin.html │ ├── 02-index.html │ ├── 03-index.html │ ├── 04-index.html │ ├── 05-index.html │ └── 01-index.html ├── webpack.config.js └── cfn-templates │ ├── fa-036-cognito-userpool.yaml │ └── fa-036-s3.yaml ├── 010 ├── html │ ├── signin.html │ ├── signout.html │ └── index.html ├── fa-010.yaml └── fa-010-s3.yaml ├── 020 ├── lambda3 │ ├── Dockerfile │ ├── mymodule.py │ └── index.py ├── lambda1 │ ├── mymodule.py │ └── index.py ├── fa-020-ssm.yaml ├── fa-020-s3-and-ecr.yaml ├── fa-020-lambda3.yaml └── fa-020-lambda1.yaml ├── 081 ├── container │ ├── main.py │ ├── test_main.py │ └── Dockerfile ├── templates │ └── fa-081-ssm.yaml └── README.md ├── 084 ├── container │ ├── main.py │ └── Dockerfile └── templates │ └── fa-084-ssm.yaml ├── 092 └── playbook │ ├── uwsgi.ini │ ├── uwsgi.service │ └── run.py ├── 075 ├── container │ ├── main.py │ └── Dockerfile └── templates │ ├── fa-075-ecr.yaml │ ├── fa-075-s3.yaml │ └── fa-075-ssm.yaml ├── 076 ├── container │ ├── main.py │ └── Dockerfile └── templates │ ├── fa-076-ecr.yaml │ ├── fa-076-s3.yaml │ └── fa-076-ssm.yaml ├── 079 ├── container │ ├── main.py │ └── Dockerfile └── templates │ └── fa-079-ssm.yaml ├── 080 ├── container │ ├── main.py │ └── Dockerfile ├── templates │ ├── fa-080-sns.yaml │ └── fa-080-ssm.yaml └── README.md ├── 074 ├── container1 │ ├── Dockerfile │ └── main.py └── fa-074-ecr.yaml ├── 047 ├── fa-047-customresource.yaml └── fa-047-s3.yaml ├── 048 ├── fa-048-customresource.yaml └── fa-048-s3.yaml ├── 049 └── fa-049-customresource.yaml ├── 050 ├── fa-050-customresource.yaml ├── fa-050-s3-01.yaml ├── fa-050-s3-02.yaml └── README.md ├── 051 ├── fa-051-customresource.yaml ├── fa-051-s3-01.yaml ├── fa-051-s3-02.yaml └── README.md ├── 056 ├── fa-056-customresource.yaml └── fa-056-lambda-01.yaml ├── 057 └── fa-057-customresource.yaml ├── 060 └── fa-060-customresource.yaml ├── 061 └── fa-061-customresource.yaml ├── 062 ├── fa-062-customresource.yaml └── fa-062-ssm.yaml ├── 078 ├── fa-078-customresource.yaml └── fa-078-ecr.yaml ├── 094 └── playbook │ ├── uwsgi.ini │ └── uwsgi.service ├── 034 ├── index.html ├── webpack.config.js └── cfn-templates │ └── fa-034-s3.yaml ├── 015 ├── fa-015-s3.yaml └── README.md ├── 016 ├── fa-016-s3.yaml └── README.md ├── 044 └── fa-044-s3.yaml ├── 025 └── playbook.yml ├── 064 └── fa-064-ssm.yaml ├── 066 └── fa-066-sns.yaml ├── 067 ├── fa-067-sns.yaml └── README.md ├── 070 ├── fa-070-sns.yaml └── fa-070-cloudwatch.yaml ├── 072 └── fa-072-sns.yaml ├── 073 └── fa-073-sns.yaml ├── 089 └── fa-089-endpoint.yaml ├── 004 └── fa-004-s3.yaml ├── 096 ├── fa-096-s3-01.yaml ├── fa-096-s3-02.yaml └── README.md ├── 077 ├── fa-077.yaml └── fa-077-ecr.yaml ├── 046 ├── fa-046-endpoint.yaml └── README.md ├── 027 └── fa-027-endpoint.yaml ├── 028 ├── fa-028-endpoint.yaml └── README.md ├── 029 └── fa-029-endpoint.yaml ├── 043 ├── fa-043-customresource.yaml ├── fa-043.yaml └── README.md ├── 045 ├── fa-045-endpoint.yaml └── README.md ├── 023 ├── fa-023-acm.yaml ├── fa-023-route53.yaml └── fa-023-endpoint.yaml ├── 024 ├── fa-024-acm.yaml └── fa-024-route53.yaml ├── 041 ├── fa-041-dynamodb.yaml └── lambda │ └── function2 │ └── index.py ├── 022 ├── fa-022-route53.yaml └── fa-022-endpoint.yaml ├── 021 ├── fa-021-sqs.yaml └── README.md ├── 042 └── fa-042.yaml ├── 003 ├── fa-003-iam.yaml ├── fa-003-ec2-02.yaml └── README.md ├── 055 └── lambda │ └── function1 │ └── index.py ├── 093 └── fa-093-endpoint.yaml ├── 097 └── fa-097.yaml ├── 098 ├── fa-098.yaml ├── fa-098-config.yaml └── README.md ├── 001 ├── fa-001-endpoint.yaml └── README.md ├── 099 └── fa-099-eventbridge.yaml ├── 017 └── fa-017-msad.yaml ├── 052 ├── fa-052.yaml └── README.md ├── 095 └── README.md ├── 013 └── README.md ├── 008 └── README.md ├── 058 └── README.md ├── 002 └── README.md ├── 090 └── README.md ├── 053 └── README.md ├── 009 └── README.md ├── 014 └── README.md ├── 005 └── README.md ├── 030 └── README.md ├── 007 └── README.md ├── 033 └── README.md ├── 038 └── README.md └── 085 └── README.md /040/python/mylayer/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /082/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | -------------------------------------------------------------------------------- /083/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | -------------------------------------------------------------------------------- /018/task2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | 3 | COPY index.html /usr/share/nginx/html 4 | 5 | EXPOSE 80 -------------------------------------------------------------------------------- /068/task2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | 3 | COPY index.html /usr/share/nginx/html 4 | 5 | EXPOSE 80 -------------------------------------------------------------------------------- /086/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | 3 | COPY index.html /usr/share/nginx/html 4 | 5 | EXPOSE 80 -------------------------------------------------------------------------------- /011/html/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

error.html

5 | 6 | -------------------------------------------------------------------------------- /011/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

index.html

5 | 6 | -------------------------------------------------------------------------------- /019/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | 3 | COPY index.html /usr/share/nginx/html 4 | 5 | #EXPOSE 80 6 | -------------------------------------------------------------------------------- /012/html/signout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

signout.html

5 | 6 | -------------------------------------------------------------------------------- /035/html/signout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

signout.html

5 | 6 | -------------------------------------------------------------------------------- /036/html/signout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

signout.html

5 | 6 | -------------------------------------------------------------------------------- /010/html/signin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

signin.html

5 | 6 | 7 | -------------------------------------------------------------------------------- /010/html/signout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

signout.html

5 | 6 | 7 | -------------------------------------------------------------------------------- /018/task2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

fa-018 index.html

6 | 7 | -------------------------------------------------------------------------------- /040/python/mylayer/mylayer.py: -------------------------------------------------------------------------------- 1 | def myfunc(func_name): 2 | return 'hello from {func_name}.'.format(func_name=func_name) 3 | -------------------------------------------------------------------------------- /068/task2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

fa-068 index.html

6 | 7 | -------------------------------------------------------------------------------- /019/container/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

fa-019 index.html

6 | 7 | -------------------------------------------------------------------------------- /086/container/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

fa-086 index.html

6 | 7 | -------------------------------------------------------------------------------- /117/sample-template/prod-stack-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters" : { 3 | "Environment": "test", 4 | "MemorySize": "512" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /117/sample-template/test-stack-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters" : { 3 | "Environment": "test", 4 | "MemorySize": "128" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /020/lambda3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM public.ecr.aws/lambda/python:3.8 2 | 3 | COPY index.py ${LAMBDA_TASK_ROOT} 4 | COPY mymodule.py ${LAMBDA_TASK_ROOT} 5 | 6 | CMD [ "index.lambda_handler" ] -------------------------------------------------------------------------------- /081/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline.' 6 | 7 | if __name__ == '__main__': 8 | run(host='0.0.0.0', port=8080) 9 | -------------------------------------------------------------------------------- /084/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline.' 6 | 7 | if __name__ == '__main__': 8 | run(host='0.0.0.0', port=8080) 9 | -------------------------------------------------------------------------------- /092/playbook/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | chdir = /home/ec2-user/myapp 3 | socket = 0.0.0.0:9090 4 | file = /home/ec2-user/myapp/run.py 5 | callable = app 6 | master = True 7 | uid = ec2-user 8 | gid = ec2-user 9 | -------------------------------------------------------------------------------- /075/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline!' 6 | 7 | 8 | if __name__ == '__main__': 9 | run(host='0.0.0.0', port=8080) 10 | -------------------------------------------------------------------------------- /076/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline.' 6 | 7 | 8 | if __name__ == '__main__': 9 | run(host='0.0.0.0', port=8080) 10 | -------------------------------------------------------------------------------- /079/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline.' 6 | 7 | 8 | if __name__ == '__main__': 9 | run(host='0.0.0.0', port=8080) 10 | -------------------------------------------------------------------------------- /081/container/test_main.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from main import hello 3 | 4 | @pytest.mark.parametrize(('expected',), [ 5 | ('Hello CodePipeline.',), 6 | ]) 7 | def test_hello(expected): 8 | assert hello() == expected 9 | -------------------------------------------------------------------------------- /075/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | RUN pip3 install bottle 5 | 6 | COPY main.py ./ 7 | 8 | CMD ["python3", "main.py"] 9 | 10 | EXPOSE 8080 11 | -------------------------------------------------------------------------------- /080/container/main.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run 2 | 3 | @route('/') 4 | def hello(): 5 | return 'Hello CodePipeline. Updated.' 6 | 7 | 8 | if __name__ == '__main__': 9 | run(host='0.0.0.0', port=8080) 10 | -------------------------------------------------------------------------------- /076/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | 7 | COPY main.py ./ 8 | 9 | CMD ["python3", "main.py"] 10 | 11 | EXPOSE 8080 12 | -------------------------------------------------------------------------------- /079/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | 7 | COPY main.py ./ 8 | 9 | CMD ["python3", "main.py"] 10 | 11 | EXPOSE 8080 12 | -------------------------------------------------------------------------------- /080/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | 7 | COPY main.py ./ 8 | 9 | CMD ["python3", "main.py"] 10 | 11 | EXPOSE 8080 12 | -------------------------------------------------------------------------------- /081/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | 7 | COPY main.py ./ 8 | 9 | CMD ["python3", "main.py"] 10 | 11 | EXPOSE 8080 12 | -------------------------------------------------------------------------------- /084/container/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | 7 | COPY main.py ./ 8 | 9 | CMD ["python3", "main.py"] 10 | 11 | EXPOSE 8080 12 | -------------------------------------------------------------------------------- /074/container1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amazonlinux 2 | 3 | RUN yum update -y && yum install python3 python3-pip -y 4 | 5 | RUN pip3 install bottle 6 | RUN pip3 install aws-xray-sdk 7 | 8 | COPY main.py ./ 9 | 10 | CMD ["python3", "main.py"] 11 | 12 | EXPOSE 8080 -------------------------------------------------------------------------------- /020/lambda1/mymodule.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import os 3 | 4 | def get_ssm_parameter(parameter_name, client=None): 5 | if not client: 6 | client = boto3.client('ssm', region_name=os.environ['region_name']) 7 | 8 | return client.get_parameter(Name=parameter_name)['Parameter']['Value'] -------------------------------------------------------------------------------- /020/lambda3/mymodule.py: -------------------------------------------------------------------------------- 1 | import boto3 2 | import os 3 | 4 | def get_ssm_parameter(parameter_name, client=None): 5 | if not client: 6 | client = boto3.client('ssm', region_name=os.environ['region_name']) 7 | 8 | return client.get_parameter(Name=parameter_name)['Parameter']['Value'] -------------------------------------------------------------------------------- /047/fa-047-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /048/fa-048-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /049/fa-049-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /050/fa-050-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /051/fa-051-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /056/fa-056-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /057/fa-057-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /060/fa-060-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /061/fa-061-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /062/fa-062-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /078/fa-078-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /105/fa-105-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | 8 | Resources: 9 | CustomResource: 10 | Type: Custom::CustomResource 11 | Properties: 12 | ServiceToken: !Ref FunctionArn 13 | -------------------------------------------------------------------------------- /012/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | module.exports = { 3 | entry: [path.join(__dirname, "browser.js")], 4 | output: { 5 | path: __dirname, 6 | filename: 'main.js' 7 | }, 8 | resolve:{ 9 | fallback: { path: require.resolve("path-browserify")} 10 | } 11 | }; -------------------------------------------------------------------------------- /035/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | module.exports = { 3 | entry: [path.join(__dirname, "browser.js")], 4 | output: { 5 | path: __dirname, 6 | filename: 'main.js' 7 | }, 8 | resolve:{ 9 | fallback: { path: require.resolve("path-browserify")} 10 | } 11 | }; -------------------------------------------------------------------------------- /036/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require("path"); 2 | module.exports = { 3 | entry: [path.join(__dirname, "browser.js")], 4 | output: { 5 | path: __dirname, 6 | filename: 'main.js' 7 | }, 8 | resolve:{ 9 | fallback: { path: require.resolve("path-browserify")} 10 | } 11 | }; -------------------------------------------------------------------------------- /137/.taskcat.yml: -------------------------------------------------------------------------------- 1 | project: 2 | name: taskcat-ci 3 | regions: 4 | - ap-northeast-1 5 | tests: 6 | default: 7 | parameters: 8 | Handler: index.lambda_handler 9 | Memory: 128 10 | Prefix: taskcat-ci 11 | Runtime: python3.8 12 | template: ./test-template.yaml 13 | -------------------------------------------------------------------------------- /035/html/signin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

signin.html

6 |

7 |

8 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /094/playbook/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | chdir = /home/ec2-user/myapp 3 | socket = 0.0.0.0:9090 4 | file = /home/ec2-user/myapp/run.py 5 | callable = app 6 | master = True 7 | uid = ec2-user 8 | gid = ec2-user 9 | 10 | logto = /var/log/uwsgi.log 11 | logfile-chown = ec2-user:ec2-user 12 | logfile-chmod = 640 13 | -------------------------------------------------------------------------------- /012/html/signin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

signin.html

6 |

7 |

8 | 9 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /109/fa-109-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | VersioningConfiguration: 15 | Status: Enabled -------------------------------------------------------------------------------- /034/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fa-034 5 | 6 | 7 |
8 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /020/lambda1/index.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import mymodule 4 | 5 | def lambda_handler(event, context): 6 | ssm_parameter_name = os.environ['ssm_parameter_name'] 7 | ssm_parameter = mymodule.get_ssm_parameter(ssm_parameter_name) 8 | 9 | return { 10 | 'statusCode': 200, 11 | 'body': json.dumps(ssm_parameter) 12 | } 13 | -------------------------------------------------------------------------------- /020/lambda3/index.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import mymodule 4 | 5 | def lambda_handler(event, context): 6 | ssm_parameter_name = os.environ['ssm_parameter_name'] 7 | ssm_parameter = mymodule.get_ssm_parameter(ssm_parameter_name) 8 | 9 | return { 10 | 'statusCode': 200, 11 | 'body': json.dumps(ssm_parameter) 12 | } 13 | -------------------------------------------------------------------------------- /150/fa-150-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /154/fa-154-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /167/fa-167-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /117/fa-117-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /127/fa-127-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | RepositoryName: !Ref Prefix 13 | 14 | 15 | Outputs: 16 | ECRRepositoryName: 17 | Value: !Ref ECRRepository 18 | -------------------------------------------------------------------------------- /129/fa-129-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | RepositoryName: !Ref Prefix 13 | 14 | 15 | Outputs: 16 | ECRRepositoryName: 17 | Value: !Ref ECRRepository 18 | -------------------------------------------------------------------------------- /136/fa-136-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /137/fa-137-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /015/fa-015-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | SSMLogBucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | SSMLogBucket: 18 | Value: !Ref SSMLogBucket -------------------------------------------------------------------------------- /016/fa-016-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | SSMLogBucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | SSMLogBucket: 18 | Value: !Ref SSMLogBucket -------------------------------------------------------------------------------- /075/templates/fa-075-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | RepositoryName: !Ref Prefix 13 | 14 | 15 | Outputs: 16 | ECRRepositoryName: 17 | Value: !Ref ECRRepository 18 | -------------------------------------------------------------------------------- /075/templates/fa-075-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /076/templates/fa-076-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | RepositoryName: !Ref Prefix 13 | 14 | 15 | Outputs: 16 | ECRRepositoryName: 17 | Value: !Ref ECRRepository 18 | -------------------------------------------------------------------------------- /076/templates/fa-076-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /106/fa-106-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | -------------------------------------------------------------------------------- /157/fa-157-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | Resources: 8 | Bucket: 9 | Type: AWS::S3::Bucket 10 | Properties: 11 | BucketName: !Ref Prefix 12 | AccessControl: Private 13 | 14 | 15 | Outputs: 16 | BucketName: 17 | Value: !Ref Bucket 18 | Export: 19 | Name: !Sub "${Prefix}-BucketName" 20 | -------------------------------------------------------------------------------- /036/html/signin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

signin.html

6 | 7 |

Access Token

8 |

9 | 10 |

ID Token

11 |

12 | 13 |

User Data

14 |

15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /153/fa-153-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | Export: 20 | Name: !Sub "${Prefix}-BucketName" 21 | -------------------------------------------------------------------------------- /155/fa-155-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | Export: 20 | Name: !Sub "${Prefix}-BucketName" 21 | -------------------------------------------------------------------------------- /156/fa-156-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | Export: 20 | Name: !Sub "${Prefix}-BucketName" 21 | -------------------------------------------------------------------------------- /163/fa-163-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | Export: 20 | Name: !Sub "${Prefix}-BucketName" 21 | -------------------------------------------------------------------------------- /164/fa-164-01-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketName: 18 | Value: !Ref Bucket 19 | Export: 20 | Name: !Sub "${Prefix}-BucketName" 21 | -------------------------------------------------------------------------------- /044/fa-044-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketArn: 18 | Value: !GetAtt Bucket.Arn 19 | 20 | BucketName: 21 | Value: !Ref Bucket -------------------------------------------------------------------------------- /078/fa-078-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | RepositoryName: !Ref Prefix 13 | 14 | Outputs: 15 | ECRRepositoryArn: 16 | Value: !GetAtt ECRRepository.Arn 17 | 18 | ECRRepositoryName: 19 | Value: !Ref ECRRepository 20 | -------------------------------------------------------------------------------- /018/fa-018-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: fa-018 7 | 8 | 9 | Resources: 10 | Repository: 11 | Type: AWS::ECR::Repository 12 | Properties: 13 | RepositoryName: !Ref Prefix 14 | 15 | 16 | Outputs: 17 | RepositoryName: 18 | Value: !Ref Repository 19 | Export: 20 | Name: !Sub "${Prefix}-RepositoryName" -------------------------------------------------------------------------------- /025/playbook.yml: -------------------------------------------------------------------------------- 1 | - hosts: all 2 | gather_facts: no 3 | become: yes 4 | 5 | tasks: 6 | - name: update yum 7 | yum: name=* 8 | - name: install the latest version of Apache 9 | yum: name=httpd state=latest 10 | - name: start and enable Apache 11 | service: name=httpd state=started enabled=yes 12 | - name: make index.html 13 | shell: ec2-metadata -i > /var/www/html/index.html 14 | -------------------------------------------------------------------------------- /068/fa-068-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: fa-068 7 | 8 | 9 | Resources: 10 | Repository: 11 | Type: AWS::ECR::Repository 12 | Properties: 13 | RepositoryName: !Ref Prefix 14 | 15 | 16 | Outputs: 17 | RepositoryName: 18 | Value: !Ref Repository 19 | Export: 20 | Name: !Sub "${Prefix}-RepositoryName" -------------------------------------------------------------------------------- /074/fa-074-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: fa-074 7 | 8 | 9 | Resources: 10 | Repository: 11 | Type: AWS::ECR::Repository 12 | Properties: 13 | RepositoryName: !Ref Prefix 14 | 15 | 16 | Outputs: 17 | RepositoryName: 18 | Value: !Ref Repository 19 | Export: 20 | Name: !Sub "${Prefix}-RepositoryName" -------------------------------------------------------------------------------- /092/playbook/uwsgi.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description = uWSGI 3 | After = syslog.target 4 | 5 | [Service] 6 | WorkingDirectory = /home/ec2-user/myapp/ 7 | ExecStart = /usr/local/bin/uwsgi --ini /home/ec2-user/myapp/uwsgi.ini 8 | 9 | Restart = on-failure 10 | RestartSec = 3 11 | KillSignal = SIGQUIT 12 | Type = notify 13 | StandardError = syslog 14 | NotifyAccess = all 15 | 16 | [Install] 17 | WantedBy = multi-user.target 18 | -------------------------------------------------------------------------------- /092/playbook/run.py: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | from flask import Flask 3 | 4 | app = Flask(__name__) 5 | url = 'http://169.254.169.254/latest/meta-data/instance-id' 6 | 7 | @app.route('/') 8 | def main(): 9 | request = urllib.request.Request(url) 10 | with urllib.request.urlopen(request) as response: 11 | data = response.read().decode('utf-8') 12 | return data 13 | 14 | if __name__ == '__main__': 15 | app.run() -------------------------------------------------------------------------------- /020/fa-020-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Name: 5 | Type: String 6 | 7 | Value: 8 | Type: String 9 | 10 | 11 | Resources: 12 | SSMParameter: 13 | Type: AWS::SSM::Parameter 14 | Properties: 15 | Name: !Ref Name 16 | Type: String 17 | Value: !Ref Value 18 | 19 | 20 | Outputs: 21 | SSMParameter: 22 | Value: !Ref SSMParameter -------------------------------------------------------------------------------- /019/fa-019-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: fa-019 7 | 8 | 9 | Resources: 10 | MyRepository: 11 | Type: AWS::ECR::Repository 12 | Properties: 13 | RepositoryName: !Sub ${Prefix}-myrepository 14 | 15 | 16 | Outputs: 17 | MyServiceRepository: 18 | Value: !Ref MyRepository 19 | Export: 20 | Name: !Sub "${Prefix}-MyRepository" -------------------------------------------------------------------------------- /012/cfn-templates/fa-012-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | AuthenticatedParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Sub "${Prefix}-authenticated" 13 | Type: String 14 | Value: Authenticated 15 | 16 | 17 | Outputs: 18 | AuthenticatedParameter: 19 | Value: !Ref AuthenticatedParameter -------------------------------------------------------------------------------- /035/cfn-templates/fa-035-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | AuthenticatedParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Sub "${Prefix}-authenticated" 13 | Type: String 14 | Value: Authenticated 15 | 16 | 17 | Outputs: 18 | AuthenticatedParameter: 19 | Value: !Ref AuthenticatedParameter -------------------------------------------------------------------------------- /130/fa-130-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | UrlsParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Ref Prefix 13 | Type: String 14 | Value: | 15 | https://data.nasa.gov/resource/gvk9-iz74.json 16 | 17 | 18 | Outputs: 19 | UrlsParameter: 20 | Value: !Ref UrlsParameter 21 | -------------------------------------------------------------------------------- /116/fa-116-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: soa-04-001 7 | 8 | 9 | Resources: 10 | S3Bucket: 11 | Type: AWS::S3::Bucket 12 | Properties: 13 | BucketName: !Ref Prefix 14 | AccessControl: Private 15 | 16 | 17 | Outputs: 18 | S3BucketArn: 19 | Value: !GetAtt S3Bucket.Arn 20 | 21 | S3BucketName: 22 | Value: !Ref S3Bucket -------------------------------------------------------------------------------- /064/fa-064-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | RequirementsParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Ref Prefix 13 | Type: String 14 | Value: | 15 | requests 16 | beautifulsoup4 17 | 18 | 19 | Outputs: 20 | RequirementsParameter: 21 | Value: !Ref RequirementsParameter -------------------------------------------------------------------------------- /167/fa-167-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | ThingPrincipalAttachment: 19 | Type: AWS::IoT::ThingPrincipalAttachment 20 | Properties: 21 | Principal: !Ref CertificateArn 22 | ThingName: !Ref Thing 23 | -------------------------------------------------------------------------------- /094/playbook/uwsgi.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description = uWSGI 3 | After = syslog.target 4 | 5 | [Service] 6 | WorkingDirectory = /home/ec2-user/myapp/ 7 | EnvironmentFile=/etc/sysconfig/uwsgi 8 | ExecStart = /usr/local/bin/uwsgi --ini /home/ec2-user/myapp/uwsgi.ini 9 | 10 | Restart = on-failure 11 | RestartSec = 3 12 | KillSignal = SIGQUIT 13 | Type = notify 14 | StandardError = syslog 15 | NotifyAccess = all 16 | 17 | [Install] 18 | WantedBy = multi-user.target 19 | -------------------------------------------------------------------------------- /101/fa-101-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Sub "${Prefix}-encryption-enabled" 13 | AccessControl: Private 14 | BucketEncryption: 15 | ServerSideEncryptionConfiguration: 16 | - ServerSideEncryptionByDefault: 17 | SSEAlgorithm: AES256 18 | -------------------------------------------------------------------------------- /103/fa-103-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Sub "${Prefix}-encryption-enabled" 13 | AccessControl: Private 14 | BucketEncryption: 15 | ServerSideEncryptionConfiguration: 16 | - ServerSideEncryptionByDefault: 17 | SSEAlgorithm: AES256 18 | -------------------------------------------------------------------------------- /104/fa-104-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Sub "${Prefix}-encryption-enabled" 13 | AccessControl: Private 14 | BucketEncryption: 15 | ServerSideEncryptionConfiguration: 16 | - ServerSideEncryptionByDefault: 17 | SSEAlgorithm: AES256 18 | -------------------------------------------------------------------------------- /142/fa-142-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | NotificationConfiguration: 15 | EventBridgeConfiguration: 16 | EventBridgeEnabled: true 17 | 18 | 19 | Outputs: 20 | BucketName: 21 | Value: !Ref Bucket 22 | -------------------------------------------------------------------------------- /147/fa-147-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | RequirementsParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Ref Prefix 13 | Type: String 14 | Value: | 15 | urllib3==1.26.6 16 | opensearch-py 17 | 18 | 19 | Outputs: 20 | RequirementsParameter: 21 | Value: !Ref RequirementsParameter -------------------------------------------------------------------------------- /148/fa-148-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | RequirementsParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Ref Prefix 13 | Type: String 14 | Value: | 15 | urllib3==1.26.6 16 | opensearch-py 17 | 18 | 19 | Outputs: 20 | RequirementsParameter: 21 | Value: !Ref RequirementsParameter -------------------------------------------------------------------------------- /066/fa-066-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /067/fa-067-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /070/fa-070-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /072/fa-072-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /073/fa-073-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /089/fa-089-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | PrivateRouteTable: 8 | Type: String 9 | 10 | VPC: 11 | Type: String 12 | 13 | 14 | Resources: 15 | S3Endpoint: 16 | Type: AWS::EC2::VPCEndpoint 17 | Properties: 18 | RouteTableIds: 19 | - !Ref PrivateRouteTable 20 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 21 | VpcId: !Ref VPC 22 | -------------------------------------------------------------------------------- /101/fa-101-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /117/fa-117-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /137/fa-137-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /139/fa-139-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | PrivateRouteTable: 8 | Type: String 9 | 10 | VPC: 11 | Type: String 12 | 13 | 14 | Resources: 15 | S3Endpoint: 16 | Type: AWS::EC2::VPCEndpoint 17 | Properties: 18 | RouteTableIds: 19 | - !Ref PrivateRouteTable 20 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 21 | VpcId: !Ref VPC 22 | -------------------------------------------------------------------------------- /004/fa-004-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | NotificationConfiguration: 15 | EventBridgeConfiguration: 16 | EventBridgeEnabled: true 17 | 18 | 19 | Outputs: 20 | BucketName: 21 | Value: !Ref Bucket 22 | -------------------------------------------------------------------------------- /141/fa-141-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | NotificationConfiguration: 15 | EventBridgeConfiguration: 16 | EventBridgeEnabled: true 17 | 18 | 19 | Outputs: 20 | BucketName: 21 | Value: !Ref Bucket 22 | -------------------------------------------------------------------------------- /143/fa-143-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Ref Prefix 14 | NotificationConfiguration: 15 | EventBridgeConfiguration: 16 | EventBridgeEnabled: true 17 | 18 | 19 | Outputs: 20 | BucketName: 21 | Value: !Ref Bucket 22 | -------------------------------------------------------------------------------- /080/templates/fa-080-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | -------------------------------------------------------------------------------- /125/fa-125-s3-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket1: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Sub "${Prefix}-sse-s3" 14 | BucketEncryption: 15 | ServerSideEncryptionConfiguration: 16 | - BucketKeyEnabled: false 17 | ServerSideEncryptionByDefault: 18 | SSEAlgorithm: AES256 19 | -------------------------------------------------------------------------------- /051/fa-051-s3-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketArn: 18 | Value: !GetAtt Bucket.Arn 19 | 20 | BucketRegionalDomainName: 21 | Value: !GetAtt Bucket.RegionalDomainName 22 | 23 | BucketName: 24 | Value: !Ref Bucket 25 | -------------------------------------------------------------------------------- /096/fa-096-s3-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketArn: 18 | Value: !GetAtt Bucket.Arn 19 | 20 | BucketRegionalDomainName: 21 | Value: !GetAtt Bucket.RegionalDomainName 22 | 23 | BucketName: 24 | Value: !Ref Bucket 25 | -------------------------------------------------------------------------------- /077/fa-077.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-077 11 | 12 | 13 | Resources: 14 | ECRStack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-ecr.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | -------------------------------------------------------------------------------- /109/fa-109.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-109 11 | 12 | 13 | Resources: 14 | S3Stack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | -------------------------------------------------------------------------------- /134/fa-134-s3-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DomainName: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref DomainName 13 | AccessControl: Private 14 | 15 | 16 | Outputs: 17 | BucketArn: 18 | Value: !GetAtt Bucket.Arn 19 | 20 | BucketName: 21 | Value: !Ref Bucket 22 | 23 | BucketRegionalDomainName: 24 | Value: !GetAtt Bucket.RegionalDomainName 25 | -------------------------------------------------------------------------------- /159/fa-159-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PhoneNumber: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | FifoTopic: false 16 | Subscription: 17 | - Endpoint: !Ref PhoneNumber 18 | Protocol: sms 19 | TopicName: !Sub "${Prefix}-sns-topic" 20 | 21 | 22 | Outputs: 23 | TopicArn: 24 | Value: !Ref Topic 25 | -------------------------------------------------------------------------------- /162/fa-162-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PhoneNumber: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | FifoTopic: false 16 | Subscription: 17 | - Endpoint: !Ref PhoneNumber 18 | Protocol: sms 19 | TopicName: !Sub "${Prefix}-sns-topic" 20 | 21 | 22 | Outputs: 23 | TopicArn: 24 | Value: !Ref Topic 25 | -------------------------------------------------------------------------------- /160/fa-160-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PhoneNumber: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | FifoTopic: false 16 | Subscription: 17 | - Endpoint: !Ref PhoneNumber 18 | Protocol: sms 19 | TopicName: !Sub "${Prefix}-sns-topic" 20 | 21 | 22 | Outputs: 23 | SnsTopicArn: 24 | Value: !Ref Topic 25 | -------------------------------------------------------------------------------- /127/fa-127-secretsmanager.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Password: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | Username: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Secret: 16 | Type: AWS::SecretsManager::Secret 17 | Properties: 18 | Name: !Ref Prefix 19 | SecretString: !Sub '{"username":"${Username}","password":"${Password}"}' 20 | 21 | 22 | Outputs: 23 | Secret: 24 | Value: !Ref Secret 25 | -------------------------------------------------------------------------------- /129/fa-129-secretsmanager.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Password: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | Username: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Secret: 16 | Type: AWS::SecretsManager::Secret 17 | Properties: 18 | Name: !Ref Prefix 19 | SecretString: !Sub '{"username":"${Username}","password":"${Password}"}' 20 | 21 | 22 | Outputs: 23 | Secret: 24 | Value: !Ref Secret 25 | -------------------------------------------------------------------------------- /108/fa-108-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ExpirationInDays: 5 | Type: Number 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Bucket: 13 | Type: AWS::S3::Bucket 14 | Properties: 15 | AccessControl: Private 16 | BucketName: !Ref Prefix 17 | LifecycleConfiguration: 18 | Rules: 19 | - ExpirationInDays: !Ref ExpirationInDays 20 | Id: !Sub "${Prefix}-Lifecyclerule" 21 | Status: Enabled 22 | -------------------------------------------------------------------------------- /046/fa-046-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | VPC: 14 | Type: String 15 | 16 | 17 | Resources: 18 | S3Endpoint: 19 | Type: AWS::EC2::VPCEndpoint 20 | Properties: 21 | RouteTableIds: 22 | - !Ref PrivateRouteTable 23 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 24 | VpcId: !Ref VPC 25 | -------------------------------------------------------------------------------- /144/fa-144-route53.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DomainName: 5 | Type: String 6 | 7 | EIP: 8 | Type: String 9 | 10 | HostedZoneId: 11 | Type: String 12 | 13 | TTL: 14 | Type: Number 15 | 16 | 17 | Resources: 18 | DnsRecord: 19 | Type: AWS::Route53::RecordSet 20 | Properties: 21 | HostedZoneId: !Ref HostedZoneId 22 | Name: !Ref DomainName 23 | ResourceRecords: 24 | - !Ref EIP 25 | TTL: !Ref TTL 26 | Type: A 27 | -------------------------------------------------------------------------------- /027/fa-027-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | VPC: 14 | Type: String 15 | 16 | 17 | Resources: 18 | S3Endpoint: 19 | Type: AWS::EC2::VPCEndpoint 20 | Properties: 21 | RouteTableIds: 22 | - !Ref PrivateRouteTable 23 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 24 | VpcId: !Ref VPC 25 | -------------------------------------------------------------------------------- /028/fa-028-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | VPC: 14 | Type: String 15 | 16 | 17 | Resources: 18 | S3Endpoint: 19 | Type: AWS::EC2::VPCEndpoint 20 | Properties: 21 | RouteTableIds: 22 | - !Ref PrivateRouteTable 23 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 24 | VpcId: !Ref VPC 25 | -------------------------------------------------------------------------------- /029/fa-029-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | VPC: 14 | Type: String 15 | 16 | 17 | Resources: 18 | S3Endpoint: 19 | Type: AWS::EC2::VPCEndpoint 20 | Properties: 21 | RouteTableIds: 22 | - !Ref PrivateRouteTable 23 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 24 | VpcId: !Ref VPC 25 | -------------------------------------------------------------------------------- /043/fa-043-customresource.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | CustomResource: 13 | Type: Custom::CustomResource 14 | Properties: 15 | ServiceToken: !Ref FunctionArn 16 | TestProperty: !Ref Prefix 17 | #TestProperty: !Sub "${Prefix}-Updated" 18 | 19 | 20 | Outputs: 21 | CustomResourceReturnValue: 22 | Value: !GetAtt CustomResource.message 23 | -------------------------------------------------------------------------------- /045/fa-045-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | VPC: 14 | Type: String 15 | 16 | 17 | Resources: 18 | S3Endpoint: 19 | Type: AWS::EC2::VPCEndpoint 20 | Properties: 21 | RouteTableIds: 22 | - !Ref PrivateRouteTable 23 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 24 | VpcId: !Ref VPC 25 | -------------------------------------------------------------------------------- /133/fa-133-code.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BranchName: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | CodeCommitRepository: 13 | Type: AWS::CodeCommit::Repository 14 | Properties: 15 | RepositoryName: !Ref Prefix 16 | 17 | 18 | Outputs: 19 | CodeCommitRepositoryArn: 20 | Value: !GetAtt CodeCommitRepository.Arn 21 | 22 | CodeCommitRepositoryCloneUrlHttp: 23 | Value: !GetAtt CodeCommitRepository.CloneUrlHttp 24 | -------------------------------------------------------------------------------- /035/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

index.html

5 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /036/html/02-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

02-index.html

5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /036/html/03-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

03-index.html

5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /036/html/04-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

04-index.html

5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /036/html/05-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

05-index.html

5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /102/fa-102-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | 25 | TopicName: 26 | Value: !GetAtt Topic.TopicName 27 | -------------------------------------------------------------------------------- /103/fa-103-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | 25 | TopicName: 26 | Value: !GetAtt Topic.TopicName 27 | -------------------------------------------------------------------------------- /104/fa-104-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MailAddress: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | Subscription: 16 | - Endpoint: !Ref MailAddress 17 | Protocol: email 18 | TopicName: !Ref Prefix 19 | 20 | 21 | Outputs: 22 | TopicArn: 23 | Value: !Ref Topic 24 | 25 | TopicName: 26 | Value: !GetAtt Topic.TopicName 27 | -------------------------------------------------------------------------------- /036/html/01-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

01-index.html

5 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /074/container1/main.py: -------------------------------------------------------------------------------- 1 | from aws_xray_sdk.core import xray_recorder 2 | from aws_xray_sdk.ext.bottle.middleware import XRayMiddleware 3 | from bottle import Bottle, route, run 4 | 5 | app = Bottle() 6 | 7 | xray_recorder.configure(service='fa-074') 8 | plugins = ('ECSPlugin',) 9 | xray_recorder.configure(plugins=plugins) 10 | 11 | app.install(XRayMiddleware(xray_recorder)) 12 | 13 | @app.route('/') 14 | def hello(): 15 | return 'Hello X-Ray!' 16 | 17 | 18 | if __name__ == '__main__': 19 | run(app=app, host='0.0.0.0', port=8080) 20 | -------------------------------------------------------------------------------- /105/music.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}, "AlbumTitle": {"S": "Somewhat Famous"}, "Awards": {"N": "1"}}, 3 | {"Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Howdy"}, "AlbumTitle": {"S": "Somewhat Famous"}, "Awards": {"N": "2"}}, 4 | {"Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"}, "AlbumTitle": {"S": "Songs About Life"}, "Awards": {"N": "10"}}, 5 | {"Artist": {"S": "Acme Band"}, "SongTitle": {"S": "PartiQL Rocks"}, "AlbumTitle": {"S": "Another Album Title"}, "Awards": {"N": "8"}} 6 | ] -------------------------------------------------------------------------------- /023/fa-023-acm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DomainName: 5 | Type: String 6 | 7 | HostedZoneId: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Certificate: 13 | Type: AWS::CertificateManager::Certificate 14 | Properties: 15 | DomainName: !Ref DomainName 16 | DomainValidationOptions: 17 | - DomainName: !Ref DomainName 18 | HostedZoneId: !Ref HostedZoneId 19 | ValidationMethod: DNS 20 | 21 | 22 | Outputs: 23 | Certificate: 24 | Value: !Ref Certificate 25 | -------------------------------------------------------------------------------- /024/fa-024-acm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DomainName: 5 | Type: String 6 | 7 | HostedZoneId: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Certificate: 13 | Type: AWS::CertificateManager::Certificate 14 | Properties: 15 | DomainName: !Ref DomainName 16 | DomainValidationOptions: 17 | - DomainName: !Ref DomainName 18 | HostedZoneId: !Ref HostedZoneId 19 | ValidationMethod: DNS 20 | 21 | 22 | Outputs: 23 | Certificate: 24 | Value: !Ref Certificate 25 | -------------------------------------------------------------------------------- /134/fa-134-acm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DomainName: 5 | Type: String 6 | 7 | HostedZoneId: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Certificate: 13 | Type: AWS::CertificateManager::Certificate 14 | Properties: 15 | DomainName: !Ref DomainName 16 | DomainValidationOptions: 17 | - DomainName: !Ref DomainName 18 | HostedZoneId: !Ref HostedZoneId 19 | ValidationMethod: DNS 20 | 21 | 22 | Outputs: 23 | Certificate: 24 | Value: !Ref Certificate 25 | -------------------------------------------------------------------------------- /050/fa-050-s3-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | #WebsiteConfiguration: 15 | # IndexDocument: index.html 16 | 17 | 18 | Outputs: 19 | BucketArn: 20 | Value: !GetAtt Bucket.Arn 21 | 22 | BucketRegionalDomainName: 23 | Value: !GetAtt Bucket.RegionalDomainName 24 | 25 | BucketName: 26 | Value: !Ref Bucket 27 | -------------------------------------------------------------------------------- /041/fa-041-dynamodb.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: dva-03-002 7 | 8 | 9 | Resources: 10 | Table: 11 | Type: AWS::DynamoDB::Table 12 | Properties: 13 | AttributeDefinitions: 14 | - AttributeName: id 15 | AttributeType: S 16 | BillingMode: PAY_PER_REQUEST 17 | KeySchema: 18 | - AttributeName: id 19 | KeyType: HASH 20 | TableName: !Sub "${Prefix}-table" 21 | 22 | 23 | Outputs: 24 | Table: 25 | Value: !Ref Table -------------------------------------------------------------------------------- /125/fa-125-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket2: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | AccessControl: Private 13 | BucketName: !Sub "${Prefix}-sse-kms-aws-managed" 14 | BucketEncryption: 15 | ServerSideEncryptionConfiguration: 16 | - BucketKeyEnabled: false 17 | ServerSideEncryptionByDefault: 18 | KMSMasterKeyID: !Sub "arn:aws:kms:${AWS::Region}:${AWS::AccountId}:alias/aws/s3" 19 | SSEAlgorithm: aws:kms 20 | -------------------------------------------------------------------------------- /035/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "035", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "path-browserify": "^1.0.1", 14 | "webpack": "^5.70.0", 15 | "webpack-cli": "^4.9.2" 16 | }, 17 | "dependencies": { 18 | "@aws-sdk/client-cognito-identity": "^3.58.0", 19 | "@aws-sdk/client-ssm": "^3.58.0", 20 | "@aws-sdk/credential-provider-cognito-identity": "^3.58.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /051/fa-051-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | OAI: 8 | Type: String 9 | 10 | 11 | Resources: 12 | BucketPolicy: 13 | Type: AWS::S3::BucketPolicy 14 | Properties: 15 | Bucket: !Ref BucketName 16 | PolicyDocument: 17 | Statement: 18 | Action: 19 | - s3:GetObject 20 | Effect: Allow 21 | Principal: 22 | AWS: !Sub "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ${OAI}" 23 | Resource: !Sub "arn:aws:s3:::${BucketName}/*" 24 | -------------------------------------------------------------------------------- /022/fa-022-route53.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ALBDnsName: 5 | Type: String 6 | 7 | ALBHostedZoneId: 8 | Type: String 9 | 10 | DomainName: 11 | Type: String 12 | 13 | HostedZoneId: 14 | Type: String 15 | 16 | Prefix: 17 | Type: String 18 | 19 | 20 | Resources: 21 | DnsRecord: 22 | Type: AWS::Route53::RecordSet 23 | Properties: 24 | HostedZoneId: !Ref HostedZoneId 25 | Name: !Ref DomainName 26 | Type: A 27 | AliasTarget: 28 | DNSName: !Ref ALBDnsName 29 | HostedZoneId: !Ref ALBHostedZoneId -------------------------------------------------------------------------------- /023/fa-023-route53.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ALBDnsName: 5 | Type: String 6 | 7 | ALBHostedZoneId: 8 | Type: String 9 | 10 | DomainName: 11 | Type: String 12 | 13 | HostedZoneId: 14 | Type: String 15 | 16 | Prefix: 17 | Type: String 18 | 19 | 20 | Resources: 21 | DnsRecord: 22 | Type: AWS::Route53::RecordSet 23 | Properties: 24 | HostedZoneId: !Ref HostedZoneId 25 | Name: !Ref DomainName 26 | Type: A 27 | AliasTarget: 28 | DNSName: !Ref ALBDnsName 29 | HostedZoneId: !Ref ALBHostedZoneId -------------------------------------------------------------------------------- /024/fa-024-route53.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ALBDnsName: 5 | Type: String 6 | 7 | ALBHostedZoneId: 8 | Type: String 9 | 10 | DomainName: 11 | Type: String 12 | 13 | HostedZoneId: 14 | Type: String 15 | 16 | Prefix: 17 | Type: String 18 | 19 | 20 | Resources: 21 | DnsRecord: 22 | Type: AWS::Route53::RecordSet 23 | Properties: 24 | HostedZoneId: !Ref HostedZoneId 25 | Name: !Ref DomainName 26 | Type: A 27 | AliasTarget: 28 | DNSName: !Ref ALBDnsName 29 | HostedZoneId: !Ref ALBHostedZoneId -------------------------------------------------------------------------------- /108/fa-108.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-108 11 | 12 | ExpirationInDays: 13 | Type: Number 14 | Default: 1 15 | 16 | 17 | Resources: 18 | S3Stack: 19 | Type: AWS::CloudFormation::Stack 20 | Properties: 21 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 22 | Parameters: 23 | ExpirationInDays: !Ref ExpirationInDays 24 | Prefix: !Ref Prefix 25 | -------------------------------------------------------------------------------- /134/fa-134-route53.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | DistributionDomainName: 5 | Type: String 6 | 7 | DistributionHostedZoneId: 8 | Type: String 9 | 10 | DomainName: 11 | Type: String 12 | 13 | HostedZoneId: 14 | Type: String 15 | 16 | 17 | Resources: 18 | DnsRecord: 19 | Type: AWS::Route53::RecordSet 20 | Properties: 21 | HostedZoneId: !Ref HostedZoneId 22 | Name: !Ref DomainName 23 | Type: A 24 | AliasTarget: 25 | DNSName: !Ref DistributionDomainName 26 | HostedZoneId: !Ref DistributionHostedZoneId 27 | -------------------------------------------------------------------------------- /010/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

index.html

5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /012/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

index.html

5 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /132/fa-132-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | PrivateSubnet1: 14 | Type: String 15 | 16 | PrivateSubnet2: 17 | Type: String 18 | 19 | VPC: 20 | Type: String 21 | 22 | 23 | Resources: 24 | S3Endpoint: 25 | Type: AWS::EC2::VPCEndpoint 26 | Properties: 27 | RouteTableIds: 28 | - !Ref PrivateRouteTable 29 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 30 | VpcId: !Ref VPC 31 | -------------------------------------------------------------------------------- /154/fa-154-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /021/fa-021-sqs.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | ReceiveMessageWaitTimeSeconds: 8 | Type: Number 9 | 10 | VisibilityTimeout: 11 | Type: Number 12 | 13 | 14 | Resources: 15 | Queue: 16 | Type: AWS::SQS::Queue 17 | Properties: 18 | QueueName: !Sub ${Prefix}-queue 19 | ReceiveMessageWaitTimeSeconds: !Ref ReceiveMessageWaitTimeSeconds 20 | VisibilityTimeout: !Ref VisibilityTimeout 21 | 22 | 23 | Outputs: 24 | QueueName: 25 | Value: !GetAtt Queue.QueueName 26 | 27 | QueueArn: 28 | Value: !GetAtt Queue.Arn -------------------------------------------------------------------------------- /114/fa-114-sqs.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | ReceiveMessageWaitTimeSeconds: 8 | Type: Number 9 | 10 | VisibilityTimeout: 11 | Type: Number 12 | 13 | 14 | Resources: 15 | Queue: 16 | Type: AWS::SQS::Queue 17 | Properties: 18 | QueueName: !Sub "${Prefix}-Queue" 19 | ReceiveMessageWaitTimeSeconds: !Ref ReceiveMessageWaitTimeSeconds 20 | VisibilityTimeout: !Ref VisibilityTimeout 21 | 22 | 23 | Outputs: 24 | QueueName: 25 | Value: !GetAtt Queue.QueueName 26 | 27 | QueueArn: 28 | Value: !GetAtt Queue.Arn -------------------------------------------------------------------------------- /153/fa-153-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /155/fa-155-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /156/fa-156-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /157/fa-157-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /163/fa-163-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /164/fa-164-02-iot-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CertificateArn: 5 | Type: String 6 | 7 | Policy: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Thing: 14 | Type: String 15 | 16 | 17 | Resources: 18 | PolicyPrincipalAttachment: 19 | Type: AWS::IoT::PolicyPrincipalAttachment 20 | Properties: 21 | PolicyName: !Ref Policy 22 | Principal: !Ref CertificateArn 23 | 24 | ThingPrincipalAttachment: 25 | Type: AWS::IoT::ThingPrincipalAttachment 26 | Properties: 27 | Principal: !Ref CertificateArn 28 | ThingName: !Ref Thing 29 | -------------------------------------------------------------------------------- /056/fa-056-lambda-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CodeS3Bucket: 5 | Type: String 6 | 7 | LayerS3Key: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | Runtime: 14 | Type: String 15 | 16 | 17 | Resources: 18 | LambdaLayer: 19 | Type: AWS::Lambda::LayerVersion 20 | Properties: 21 | CompatibleRuntimes: 22 | - !Ref Runtime 23 | Content: 24 | S3Bucket: !Ref CodeS3Bucket 25 | S3Key: !Ref LayerS3Key 26 | Description: !Ref Prefix 27 | LayerName: !Ref Prefix 28 | 29 | 30 | Outputs: 31 | LambdaLayer: 32 | Value: !Ref LambdaLayer 33 | -------------------------------------------------------------------------------- /149/fa-149-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | #Handler: 5 | # Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | #Runtime: 11 | # Type: String 12 | 13 | 14 | Resources: 15 | Bucket: 16 | Type: AWS::S3::Bucket 17 | Properties: 18 | BucketName: !Ref Prefix 19 | AccessControl: Private 20 | 21 | 22 | Outputs: 23 | #BucketArn: 24 | # Value: !GetAtt Bucket.Arn 25 | 26 | #BucketRegionalDomainName: 27 | # #Value: !GetAtt Bucket.DomainName 28 | # Value: !GetAtt Bucket.RegionalDomainName 29 | 30 | #BucketWebsiteURL: 31 | # Value: !GetAtt Bucket.WebsiteURL 32 | 33 | BucketName: 34 | Value: !Ref Bucket -------------------------------------------------------------------------------- /152/fa-152-02-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | NodeId: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | WaitForSuccessTimeoutSeconds: 11 | Type: Number 12 | 13 | 14 | Resources: 15 | RunShellScriptAssociation: 16 | Type: AWS::SSM::Association 17 | Properties: 18 | AssociationName: !Sub "${Prefix}-shellscript-association" 19 | Name: AWS-RunShellScript 20 | Parameters: 21 | commands: 22 | - "touch /tmp/test.txt" 23 | Targets: 24 | - Key: InstanceIds 25 | Values: 26 | - !Ref NodeId 27 | WaitForSuccessTimeoutSeconds: !Ref WaitForSuccessTimeoutSeconds 28 | -------------------------------------------------------------------------------- /042/fa-042.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-042 11 | 12 | 13 | Resources: 14 | OpenSearchStack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-opensearch.yaml" 18 | Parameters: 19 | DomainName: !Ref Prefix 20 | EngineVersion: OpenSearch_1.2 21 | InstanceCount: 1 22 | InstanceType: t3.small.search 23 | MasterUserName: test 24 | MasterUserPassword: P@ssw0rd 25 | VolumeSize: 10 26 | -------------------------------------------------------------------------------- /145/fa-145-ec2.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | Parameters: 3 | InstanceSecurityGroup: 4 | Type: String 5 | 6 | InstanceType: 7 | Type: String 8 | 9 | ParameterAmi: 10 | Type: String 11 | 12 | Prefix: 13 | Type: String 14 | 15 | PublicSubnet1: 16 | Type: String 17 | 18 | 19 | Resources: 20 | Instance: 21 | Type: AWS::EC2::Instance 22 | Properties: 23 | ImageId: !Sub "{{resolve:ssm:${ParameterAmi}}}" 24 | InstanceType: !Ref InstanceType 25 | NetworkInterfaces: 26 | - AssociatePublicIpAddress: true 27 | DeviceIndex: 0 28 | GroupSet: 29 | - !Ref InstanceSecurityGroup 30 | SubnetId: !Ref PublicSubnet1 31 | -------------------------------------------------------------------------------- /050/fa-050-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | OAI: 8 | Type: String 9 | 10 | 11 | Resources: 12 | BucketPolicy: 13 | Type: AWS::S3::BucketPolicy 14 | Properties: 15 | Bucket: !Ref BucketName 16 | PolicyDocument: 17 | Statement: 18 | Action: 19 | - s3:GetObject 20 | Effect: Allow 21 | Principal: 22 | AWS: !Sub "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ${OAI}" 23 | Resource: !Sub "arn:aws:s3:::${BucketName}/*" 24 | #Condition: 25 | # StringLike: 26 | # aws:Referer: 27 | # - !Ref Prefix 28 | -------------------------------------------------------------------------------- /082/fa-082.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-082 11 | 12 | LambdaHandler: 13 | Type: String 14 | Default: index.lambda_handler 15 | 16 | LambdaRuntime: 17 | Type: String 18 | Default: python3.8 19 | 20 | 21 | Resources: 22 | ECRStack: 23 | Type: AWS::CloudFormation::Stack 24 | Properties: 25 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-ecr.yaml" 26 | Parameters: 27 | Handler: !Ref LambdaHandler 28 | Prefix: !Ref Prefix 29 | Runtime: !Ref LambdaRuntime 30 | -------------------------------------------------------------------------------- /083/fa-083.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-083 11 | 12 | LambdaHandler: 13 | Type: String 14 | Default: index.lambda_handler 15 | 16 | LambdaRuntime: 17 | Type: String 18 | Default: python3.8 19 | 20 | 21 | Resources: 22 | ECRStack: 23 | Type: AWS::CloudFormation::Stack 24 | Properties: 25 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-ecr.yaml" 26 | Parameters: 27 | Handler: !Ref LambdaHandler 28 | Prefix: !Ref Prefix 29 | Runtime: !Ref LambdaRuntime 30 | -------------------------------------------------------------------------------- /070/fa-070-cloudwatch.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ClusterName: 5 | Type: String 6 | 7 | ServiceName: 8 | Type: String 9 | 10 | TopicArn: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Alarm: 16 | Type: AWS::CloudWatch::Alarm 17 | Properties: 18 | AlarmActions: 19 | - !Ref TopicArn 20 | ComparisonOperator: GreaterThanThreshold 21 | Dimensions: 22 | - Name: ClusterName 23 | Value: !Ref ClusterName 24 | - Name: ServiceName 25 | Value: !Ref ServiceName 26 | EvaluationPeriods: 1 27 | MetricName: CPUUtilization 28 | Namespace: AWS/ECS 29 | Period: 60 30 | Statistic: Average 31 | Threshold: 0.1 32 | -------------------------------------------------------------------------------- /020/fa-020-s3-and-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | Default: fa-020 7 | 8 | 9 | Resources: 10 | S3Bucket: 11 | Type: AWS::S3::Bucket 12 | Properties: 13 | BucketName: !Sub "${Prefix}-bucket" 14 | AccessControl: Private 15 | 16 | ECRRepository: 17 | Type: AWS::ECR::Repository 18 | Properties: 19 | RepositoryName: !Sub ${Prefix}-repository 20 | 21 | 22 | Outputs: 23 | S3Bucket: 24 | Value: !Ref S3Bucket 25 | Export: 26 | Name: !Sub "${Prefix}-S3Bucket" 27 | 28 | ECRRepositoryUri: 29 | Value: !GetAtt ECRRepository.RepositoryUri 30 | Export: 31 | Name: !Sub "${Prefix}-ECRRepositoryUri" 32 | -------------------------------------------------------------------------------- /041/lambda/function2/index.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from gql import Client, gql 4 | from gql.transport.aiohttp import AIOHTTPTransport 5 | 6 | api_key = os.environ['API_KEY'] 7 | graphql_url = os.environ['GRAPHQL_URL'] 8 | 9 | transport = AIOHTTPTransport( 10 | url=graphql_url, 11 | headers={ 12 | 'x-api-key': api_key 13 | }) 14 | client = Client(transport=transport, fetch_schema_from_transport=True) 15 | 16 | query = gql( 17 | """ 18 | query ListDatetimesQuery { 19 | listDatetimes { 20 | id 21 | datetime 22 | } 23 | } 24 | """) 25 | 26 | def lambda_handler(event, context): 27 | result = client.execute(query) 28 | 29 | return { 30 | 'statusCode': 200, 31 | 'body': json.dumps(result, indent=2) 32 | } 33 | -------------------------------------------------------------------------------- /096/fa-096-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | Distribution: 8 | Type: String 9 | 10 | 11 | Resources: 12 | BucketPolicy: 13 | Type: AWS::S3::BucketPolicy 14 | Properties: 15 | Bucket: !Ref BucketName 16 | PolicyDocument: 17 | Statement: 18 | Action: 19 | - s3:GetObject 20 | Effect: Allow 21 | Principal: 22 | Service: 23 | - cloudfront.amazonaws.com 24 | Resource: !Sub "arn:aws:s3:::${BucketName}/*" 25 | Condition: 26 | StringEquals: 27 | AWS:SourceArn: !Sub "arn:aws:cloudfront::${AWS::AccountId}:distribution/${Distribution}" 28 | -------------------------------------------------------------------------------- /100/fa-100-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Function1: 5 | Type: String 6 | 7 | FunctionArn1: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Topic: 16 | Type: AWS::SNS::Topic 17 | Properties: 18 | Subscription: 19 | - Endpoint: !Ref FunctionArn1 20 | Protocol: lambda 21 | TopicName: !Ref Prefix 22 | 23 | SNSPermission: 24 | Type: AWS::Lambda::Permission 25 | Properties: 26 | FunctionName: !Ref Function1 27 | Action: lambda:InvokeFunction 28 | Principal: sns.amazonaws.com 29 | SourceArn: !Ref Topic 30 | 31 | 32 | Outputs: 33 | TopicArn: 34 | Value: !Ref Topic 35 | -------------------------------------------------------------------------------- /134/fa-134-s3-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | Distribution: 8 | Type: String 9 | 10 | 11 | Resources: 12 | BucketPolicy: 13 | Type: AWS::S3::BucketPolicy 14 | Properties: 15 | Bucket: !Ref BucketName 16 | PolicyDocument: 17 | Statement: 18 | Action: 19 | - s3:GetObject 20 | Effect: Allow 21 | Principal: 22 | Service: 23 | - cloudfront.amazonaws.com 24 | Resource: !Sub "arn:aws:s3:::${BucketName}/*" 25 | Condition: 26 | StringEquals: 27 | AWS:SourceArn: !Sub "arn:aws:cloudfront::${AWS::AccountId}:distribution/${Distribution}" 28 | -------------------------------------------------------------------------------- /158/fa-158.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-158 11 | 12 | DestTopicName: 13 | Type: String 14 | Default: device/data/temp 15 | 16 | SourceTopicName: 17 | Type: String 18 | Default: device/+/data 19 | 20 | 21 | Resources: 22 | IoTStack: 23 | Type: AWS::CloudFormation::Stack 24 | Properties: 25 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-iot.yaml" 26 | Parameters: 27 | DestTopicName: !Ref DestTopicName 28 | Prefix: !Ref Prefix 29 | SourceTopicName: !Ref SourceTopicName 30 | -------------------------------------------------------------------------------- /123/fa-123-eventbridge.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Function: 5 | Type: String 6 | 7 | FunctionArn: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Rule: 16 | Type: AWS::Events::Rule 17 | Properties: 18 | Name: !Sub "${Prefix}-EventsRule" 19 | ScheduleExpression: rate(1 minute) 20 | State: ENABLED 21 | Targets: 22 | - Arn: !Ref FunctionArn 23 | Id: !Ref Function 24 | 25 | EventsRulePermission: 26 | Type: AWS::Lambda::Permission 27 | Properties: 28 | FunctionName: !Ref Function 29 | Action: lambda:InvokeFunction 30 | Principal: events.amazonaws.com 31 | SourceArn: !GetAtt Rule.Arn 32 | -------------------------------------------------------------------------------- /152/fa-152-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: awstut-bucket 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-152 11 | 12 | NodeId: 13 | Type: String 14 | Default: [managed-node-id] 15 | 16 | WaitForSuccessTimeoutSeconds: 17 | Type: Number 18 | Default: 300 19 | 20 | Resources: 21 | SSMStack: 22 | Type: AWS::CloudFormation::Stack 23 | Properties: 24 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-02-ssm.yaml" 25 | Parameters: 26 | NodeId: !Ref NodeId 27 | Prefix: !Ref Prefix 28 | WaitForSuccessTimeoutSeconds: !Ref WaitForSuccessTimeoutSeconds 29 | -------------------------------------------------------------------------------- /003/fa-003-iam.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Resources: 4 | InstanceProfile: 5 | Type: AWS::IAM::InstanceProfile 6 | Properties: 7 | Path: / 8 | Roles: 9 | - !Ref InstanceRole 10 | 11 | InstanceRole: 12 | Type: AWS::IAM::Role 13 | DeletionPolicy: Delete 14 | Properties: 15 | AssumeRolePolicyDocument: 16 | Version: 2012-10-17 17 | Statement: 18 | - Effect: Allow 19 | Action: sts:AssumeRole 20 | Principal: 21 | Service: 22 | - ec2.amazonaws.com 23 | ManagedPolicyArns: 24 | - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore 25 | 26 | 27 | Outputs: 28 | InstanceProfile: 29 | Value: !Ref InstanceProfile -------------------------------------------------------------------------------- /157/fa-157-02-iot-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Thing: 10 | Type: AWS::IoT::Thing 11 | Properties: 12 | ThingName: !Sub "${Prefix}-thing" 13 | 14 | Policy: 15 | Type: AWS::IoT::Policy 16 | Properties: 17 | PolicyDocument: 18 | Version: 2012-10-17 19 | Statement: 20 | - Effect: Allow 21 | Action: 22 | - iot:Publish 23 | - iot:Receive 24 | - iot:Subscribe 25 | - iot:Connect 26 | Resource: "*" 27 | PolicyName: !Sub "${Prefix}-policy" 28 | 29 | 30 | Outputs: 31 | Thing: 32 | Value: !Ref Thing 33 | 34 | Policy: 35 | Value: !Ref Policy 36 | -------------------------------------------------------------------------------- /168/fa-168-iot.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | FunctionArn: 5 | Type: String 6 | 7 | FunctionName: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Authorizer: 16 | Type: AWS::IoT::Authorizer 17 | Properties: 18 | AuthorizerFunctionArn: !Ref FunctionArn 19 | AuthorizerName: !Sub "${Prefix}-authorizer" 20 | SigningDisabled: true 21 | Status: ACTIVE 22 | 23 | Permission: 24 | Type: AWS::Lambda::Permission 25 | Properties: 26 | Action: lambda:InvokeFunction 27 | FunctionName: !Ref FunctionName 28 | Principal: iot.amazonaws.com 29 | SourceArn: !GetAtt Authorizer.Arn 30 | 31 | 32 | Outputs: 33 | Authorizer: 34 | Value: !Ref Authorizer 35 | -------------------------------------------------------------------------------- /003/fa-003-ec2-02.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ImageId: 5 | Type: AWS::SSM::Parameter::Value 6 | 7 | InstanceProfile: 8 | Type: String 9 | 10 | InstanceSecurityGroup3: 11 | Type: String 12 | 13 | InstanceType: 14 | Type: String 15 | 16 | Prefix: 17 | Type: String 18 | 19 | PrivateSubnet2: 20 | Type: String 21 | 22 | 23 | Resources: 24 | Instance4: 25 | Type: AWS::EC2::Instance 26 | Properties: 27 | IamInstanceProfile: !Ref InstanceProfile 28 | ImageId: !Ref ImageId 29 | InstanceType: !Ref InstanceType 30 | NetworkInterfaces: 31 | - DeviceIndex: 0 32 | SubnetId: !Ref PrivateSubnet2 33 | GroupSet: 34 | - !Ref InstanceSecurityGroup3 35 | -------------------------------------------------------------------------------- /107/fa-107-dynamodb.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Table: 10 | Type: AWS::DynamoDB::Table 11 | Properties: 12 | AttributeDefinitions: 13 | - AttributeName: UserName 14 | AttributeType: S 15 | - AttributeName: SessionId 16 | AttributeType: S 17 | BillingMode: PAY_PER_REQUEST 18 | KeySchema: 19 | - AttributeName: UserName 20 | KeyType: HASH 21 | - AttributeName: SessionId 22 | KeyType: RANGE 23 | TableClass: STANDARD 24 | TableName: !Ref Prefix 25 | TimeToLiveSpecification: 26 | AttributeName: TTL 27 | Enabled: true 28 | 29 | 30 | Outputs: 31 | Table: 32 | Value: !Ref Table 33 | -------------------------------------------------------------------------------- /055/lambda/function1/index.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import time 4 | from gql import Client, gql 5 | from gql.transport.aiohttp import AIOHTTPTransport 6 | 7 | api_key = os.environ['API_KEY'] 8 | graphql_url = os.environ['GRAPHQL_URL'] 9 | 10 | transport = AIOHTTPTransport( 11 | url=graphql_url, 12 | headers={ 13 | 'x-api-key': api_key 14 | }) 15 | client = Client(transport=transport, fetch_schema_from_transport=True) 16 | 17 | 18 | def lambda_handler(event, context): 19 | document = gql( 20 | """ 21 | query ListSampleDatas { 22 | listSampleDatas { 23 | key 24 | datetime 25 | } 26 | } 27 | """ 28 | ) 29 | result = client.execute(document) 30 | 31 | return { 32 | 'statusCode': 200, 33 | 'body': json.dumps(result, indent=2) 34 | } 35 | -------------------------------------------------------------------------------- /093/fa-093-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PrivateRouteTable: 5 | Type: String 6 | 7 | VPC: 8 | Type: String 9 | 10 | 11 | Resources: 12 | S3Endpoint: 13 | Type: AWS::EC2::VPCEndpoint 14 | Properties: 15 | PolicyDocument: 16 | Version: 2012-10-17 17 | Statement: 18 | - Effect: Allow 19 | Principal: '*' 20 | Action: 21 | - s3:GetObject 22 | Resource: 23 | - !Sub "arn:aws:s3:::amazonlinux.${AWS::Region}.amazonaws.com/*" 24 | - !Sub "arn:aws:s3:::amazonlinux-2-repos-${AWS::Region}/*" 25 | RouteTableIds: 26 | - !Ref PrivateRouteTable 27 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 28 | VpcId: !Ref VPC 29 | -------------------------------------------------------------------------------- /146/fa-146-organizations.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | AccountName: 5 | Type: String 6 | 7 | Email: 8 | Type: String 9 | 10 | OUName: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Organization: 16 | Type: AWS::Organizations::Organization 17 | Properties: 18 | FeatureSet: ALL 19 | 20 | OrganizationalUnit: 21 | Type: AWS::Organizations::OrganizationalUnit 22 | Properties: 23 | Name: !Ref OUName 24 | ParentId: !GetAtt Organization.RootId 25 | 26 | Account: 27 | Type: AWS::Organizations::Account 28 | Properties: 29 | AccountName: !Ref AccountName 30 | Email: !Ref Email 31 | ParentIds: 32 | - !Ref OrganizationalUnit 33 | RoleName: OrganizationAccountAccessRole 34 | -------------------------------------------------------------------------------- /146/fa-146.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: awstut-bucket 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-146 11 | 12 | AccountName: 13 | Type: String 14 | Default: [account-name] 15 | 16 | Email: 17 | Type: String 18 | Default: [mail-address] 19 | 20 | OUName: 21 | Type: String 22 | Default: dev 23 | 24 | 25 | Resources: 26 | OrganizationsStack: 27 | Type: AWS::CloudFormation::Stack 28 | Properties: 29 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-organizations.yaml" 30 | Parameters: 31 | AccountName: !Ref AccountName 32 | Email: !Ref Email 33 | OUName: !Ref OUName 34 | -------------------------------------------------------------------------------- /047/fa-047-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | AccessControl: Private 14 | WebsiteConfiguration: 15 | IndexDocument: index.html 16 | 17 | BucketPolicy: 18 | Type: AWS::S3::BucketPolicy 19 | Properties: 20 | Bucket: !Ref Bucket 21 | PolicyDocument: 22 | Statement: 23 | Action: 24 | - s3:GetObject 25 | Effect: Allow 26 | Resource: !Sub "arn:aws:s3:::${Bucket}/*" 27 | Principal: "*" 28 | 29 | 30 | Outputs: 31 | BucketArn: 32 | Value: !GetAtt Bucket.Arn 33 | 34 | BucketName: 35 | Value: !Ref Bucket -------------------------------------------------------------------------------- /161/fa-161-dynamodb.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PartitionKey: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | SortKey: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Table: 16 | Type: AWS::DynamoDB::Table 17 | Properties: 18 | AttributeDefinitions: 19 | - AttributeName: !Ref PartitionKey 20 | AttributeType: N 21 | - AttributeName: !Ref SortKey 22 | AttributeType: N 23 | BillingMode: PAY_PER_REQUEST 24 | KeySchema: 25 | - AttributeName: !Ref PartitionKey 26 | KeyType: HASH 27 | - AttributeName: !Ref SortKey 28 | KeyType: RANGE 29 | TableClass: STANDARD 30 | TableName: wx_data 31 | 32 | 33 | Outputs: 34 | Table: 35 | Value: !Ref Table 36 | -------------------------------------------------------------------------------- /164/fa-164-02-dynamodb.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PartitionKey: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | SortKey: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Table: 16 | Type: AWS::DynamoDB::Table 17 | Properties: 18 | AttributeDefinitions: 19 | - AttributeName: !Ref PartitionKey 20 | AttributeType: S 21 | - AttributeName: !Ref SortKey 22 | AttributeType: N 23 | BillingMode: PAY_PER_REQUEST 24 | KeySchema: 25 | - AttributeName: !Ref PartitionKey 26 | KeyType: HASH 27 | - AttributeName: !Ref SortKey 28 | KeyType: RANGE 29 | TableClass: STANDARD 30 | TableName: !Sub "${Prefix}-table" 31 | 32 | 33 | Outputs: 34 | Table: 35 | Value: !Ref Table 36 | -------------------------------------------------------------------------------- /020/fa-020-lambda3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Handler: 5 | Type: String 6 | 7 | ImageUri: 8 | Type: String 9 | 10 | LambdaRoleArn: 11 | Type: String 12 | 13 | MemorySize: 14 | Type: Number 15 | 16 | Prefix: 17 | Type: String 18 | 19 | Runtime: 20 | Type: String 21 | 22 | SSMParameter: 23 | Type: String 24 | 25 | 26 | Resources: 27 | Function3: 28 | Type: AWS::Lambda::Function 29 | Properties: 30 | Code: 31 | ImageUri: !Ref ImageUri 32 | Environment: 33 | Variables: 34 | ssm_parameter_name: !Ref SSMParameter 35 | region_name: !Ref AWS::Region 36 | FunctionName: !Sub ${Prefix}-function3 37 | MemorySize: !Ref MemorySize 38 | PackageType: Image 39 | Role: !Ref LambdaRoleArn 40 | -------------------------------------------------------------------------------- /097/fa-097.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-097 11 | 12 | 13 | Resources: 14 | S3Stack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | 21 | ConfigStack: 22 | Type: AWS::CloudFormation::Stack 23 | DependsOn: 24 | - S3Stack 25 | Properties: 26 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-config.yaml" 27 | Parameters: 28 | ConfigBucket: !GetAtt S3Stack.Outputs.ConfigBucket 29 | Prefix: !Ref Prefix 30 | -------------------------------------------------------------------------------- /098/fa-098.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-098 11 | 12 | 13 | Resources: 14 | S3Stack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | 21 | ConfigStack: 22 | Type: AWS::CloudFormation::Stack 23 | DependsOn: 24 | - S3Stack 25 | Properties: 26 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-config.yaml" 27 | Parameters: 28 | ConfigBucket: !GetAtt S3Stack.Outputs.ConfigBucket 29 | Prefix: !Ref Prefix 30 | -------------------------------------------------------------------------------- /131/fa-131.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-131 11 | 12 | 13 | Resources: 14 | S3Stack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | 21 | ConfigStack: 22 | Type: AWS::CloudFormation::Stack 23 | DependsOn: 24 | - S3Stack 25 | Properties: 26 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-config.yaml" 27 | Parameters: 28 | ConfigBucket: !GetAtt S3Stack.Outputs.ConfigBucket 29 | Prefix: !Ref Prefix 30 | -------------------------------------------------------------------------------- /001/fa-001-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | PrivateRouteTable: 8 | Type: String 9 | 10 | PrivateSubnet1: 11 | Type: String 12 | 13 | PrivateSubnet2: 14 | Type: String 15 | 16 | VPC: 17 | Type: String 18 | 19 | 20 | Resources: 21 | S3Endpoint: 22 | Type: AWS::EC2::VPCEndpoint 23 | Properties: 24 | PolicyDocument: 25 | Version: 2012-10-17 26 | Statement: 27 | - Effect: Allow 28 | Principal: "*" 29 | Action: 30 | - s3:GetObject 31 | Resource: 32 | - !Sub "arn:aws:s3:::al2023-repos-${AWS::Region}-de612dc2/*" 33 | RouteTableIds: 34 | - !Ref PrivateRouteTable 35 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 36 | VpcId: !Ref VPC 37 | -------------------------------------------------------------------------------- /113/fa-113-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | Function1Arn: 8 | Type: String 9 | 10 | QueueArn: 11 | Type: String 12 | 13 | TopicArn: 14 | Type: String 15 | 16 | 17 | Resources: 18 | Bucket: 19 | Type: AWS::S3::Bucket 20 | Properties: 21 | AccessControl: Private 22 | BucketName: !Ref BucketName 23 | NotificationConfiguration: 24 | LambdaConfigurations: 25 | - Event: "s3:ObjectCreated:*" 26 | Function: !Ref Function1Arn 27 | QueueConfigurations: 28 | - Event: "s3:ObjectTagging:*" 29 | Queue: !Ref QueueArn 30 | TopicConfigurations: 31 | - Event: "s3:ObjectRemoved:*" 32 | Topic: !Ref TopicArn 33 | EventBridgeConfiguration: 34 | EventBridgeEnabled: true 35 | -------------------------------------------------------------------------------- /076/templates/fa-076-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername 36 | -------------------------------------------------------------------------------- /079/templates/fa-079-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername 36 | -------------------------------------------------------------------------------- /075/templates/fa-075-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername 36 | -------------------------------------------------------------------------------- /077/fa-077-ecr.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | ECRRepository: 10 | Type: AWS::ECR::Repository 11 | Properties: 12 | LifecyclePolicy: 13 | LifecyclePolicyText: | 14 | { 15 | "rules": [ 16 | { 17 | "rulePriority": 1, 18 | "description": "Keep only one untagged image, expire all others", 19 | "selection": { 20 | "tagStatus": "untagged", 21 | "countType": "imageCountMoreThan", 22 | "countNumber": 1 23 | }, 24 | "action": { 25 | "type": "expire" 26 | } 27 | } 28 | ] 29 | } 30 | RegistryId: !Ref AWS::AccountId 31 | RepositoryName: !Ref Prefix 32 | -------------------------------------------------------------------------------- /080/templates/fa-080-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername 36 | -------------------------------------------------------------------------------- /081/templates/fa-081-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername 36 | -------------------------------------------------------------------------------- /084/templates/fa-084-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | DockerHubPassword: 8 | Type: String 9 | 10 | DockerHubUsername: 11 | Type: String 12 | 13 | 14 | Resources: 15 | SSMParameterDockerHubPassword: 16 | Type: AWS::SSM::Parameter 17 | Properties: 18 | Name: !Sub "${Prefix}-DockerHubPassword" 19 | Type: String 20 | Value: !Ref DockerHubPassword 21 | 22 | SSMParameterDockerHubUsername: 23 | Type: AWS::SSM::Parameter 24 | Properties: 25 | Name: !Sub "${Prefix}-DockerHubUsername" 26 | Type: String 27 | Value: !Ref DockerHubUsername 28 | 29 | 30 | Outputs: 31 | SSMParameterDockerHubPassword: 32 | Value: !Ref SSMParameterDockerHubPassword 33 | 34 | SSMParameterDockerHubUsername: 35 | Value: !Ref SSMParameterDockerHubUsername -------------------------------------------------------------------------------- /019/fa-019-fargate.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Cluster: 10 | Type: AWS::ECS::Cluster 11 | Properties: 12 | ClusterName: !Sub "${Prefix}-cluster" 13 | 14 | FargateTaskExecutionRole: 15 | Type: AWS::IAM::Role 16 | Properties: 17 | AssumeRolePolicyDocument: 18 | Version: 2012-10-17 19 | Statement: 20 | - Effect: Allow 21 | Principal: 22 | Service: 23 | - ecs-tasks.amazonaws.com 24 | Action: 25 | - sts:AssumeRole 26 | ManagedPolicyArns: 27 | - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy 28 | 29 | 30 | Outputs: 31 | Cluster: 32 | Value: !Ref Cluster 33 | 34 | FargateTaskExecutionRole: 35 | Value: !Ref FargateTaskExecutionRole -------------------------------------------------------------------------------- /036/cfn-templates/fa-036-cognito-userpool.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | UserPool: 10 | Type: AWS::Cognito::UserPool 11 | Properties: 12 | AutoVerifiedAttributes: 13 | - email 14 | UsernameAttributes: 15 | - email 16 | UserPoolName: !Sub "${Prefix}-UserPool" 17 | Schema: 18 | - AttributeDataType: String 19 | Mutable: true 20 | Name: name 21 | Required: true 22 | - AttributeDataType: String 23 | Mutable: true 24 | Name: phone_number 25 | Required: true 26 | 27 | UserPoolDomain: 28 | Type: AWS::Cognito::UserPoolDomain 29 | Properties: 30 | Domain: !Ref Prefix 31 | UserPoolId: !Ref UserPool 32 | 33 | 34 | Outputs: 35 | UserPool: 36 | Value: !Ref UserPool 37 | -------------------------------------------------------------------------------- /118/fa-118-ssm-iam.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Resources: 4 | CreateImageRole: 5 | Type: AWS::IAM::Role 6 | DeletionPolicy: Delete 7 | Properties: 8 | AssumeRolePolicyDocument: 9 | Version: 2012-10-17 10 | Statement: 11 | - Effect: Allow 12 | Action: sts:AssumeRole 13 | Principal: 14 | Service: 15 | - ssm.amazonaws.com 16 | Policies: 17 | - PolicyName: CreateImagePolicy 18 | PolicyDocument: 19 | Version: 2012-10-17 20 | Statement: 21 | - Effect: Allow 22 | Action: 23 | - ec2:CreateImage 24 | - ec2:DescribeInstances 25 | Resource: 26 | - "*" 27 | 28 | 29 | Outputs: 30 | CreateImageRoleArn: 31 | Value: !GetAtt CreateImageRole.Arn 32 | -------------------------------------------------------------------------------- /034/webpack.config.js: -------------------------------------------------------------------------------- 1 | // Import path for resolving file paths 2 | var path = require("path"); 3 | module.exports = { 4 | // Specify the entry point for our app. 5 | entry: [path.join(__dirname, "browser.js")], 6 | // Specify the output file containing our bundled code. 7 | output: { 8 | path: __dirname, 9 | filename: 'main.js' 10 | }, 11 | // Enable WebPack to use the 'path' package. 12 | resolve:{ 13 | fallback: { path: require.resolve("path-browserify")} 14 | } 15 | /** 16 | * In Webpack version v2.0.0 and earlier, you must tell 17 | * webpack how to use "json-loader" to load 'json' files. 18 | * To do this Enter 'npm --save-dev install json-loader' at the 19 | * command line to install the "json-loader' package, and include the 20 | * following entry in your webpack.config.js. 21 | * module: { 22 | rules: [{test: /\.json$/, use: use: "json-loader"}] 23 | } 24 | **/ 25 | }; -------------------------------------------------------------------------------- /099/fa-099-eventbridge.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EventBusName: 5 | Type: String 6 | 7 | Function2: 8 | Type: String 9 | 10 | FunctionArn2: 11 | Type: String 12 | 13 | Prefix: 14 | Type: String 15 | 16 | 17 | Resources: 18 | EventsRule: 19 | Type: AWS::Events::Rule 20 | Properties: 21 | EventBusName: !Ref EventBusName 22 | EventPattern: 23 | source: 24 | - !Ref Prefix 25 | Name: !Sub "${Prefix}-EventsRule" 26 | State: ENABLED 27 | Targets: 28 | - Arn: !Ref FunctionArn2 29 | Id: !Ref Function2 30 | 31 | EventsRulePermission: 32 | Type: AWS::Lambda::Permission 33 | Properties: 34 | FunctionName: !Ref Function2 35 | Action: lambda:InvokeFunction 36 | Principal: events.amazonaws.com 37 | SourceArn: !GetAtt EventsRule.Arn 38 | -------------------------------------------------------------------------------- /152/fa-152-01-iam.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | SSMServiceRole: 10 | Type: AWS::IAM::Role 11 | DeletionPolicy: Delete 12 | Properties: 13 | AssumeRolePolicyDocument: 14 | Version: 2012-10-17 15 | Statement: 16 | - Effect: Allow 17 | Action: sts:AssumeRole 18 | Principal: 19 | Service: 20 | - ssm.amazonaws.com 21 | Condition: 22 | StringEquals: 23 | aws:SourceAccount: !Ref AWS::AccountId 24 | ArnEquals: 25 | aws:SourceArn: !Sub "arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:*" 26 | ManagedPolicyArns: 27 | - arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore 28 | 29 | 30 | Outputs: 31 | SSMServiceRole: 32 | Value: !Ref SSMServiceRole 33 | -------------------------------------------------------------------------------- /010/fa-010.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-010 11 | 12 | 13 | Resources: 14 | S3Stack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-s3.yaml" 18 | Parameters: 19 | Prefix: !Ref Prefix 20 | 21 | CognitoStack: 22 | Type: AWS::CloudFormation::Stack 23 | Properties: 24 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-cognito.yaml" 25 | Parameters: 26 | BucketWesSiteEndpointUrl: !GetAtt S3Stack.Outputs.BucketWesSiteEndpointUrl 27 | Prefix: !Ref Prefix 28 | SigninHtml: signin.html 29 | SignoutHtml: signout.html 30 | -------------------------------------------------------------------------------- /118/fa-118-ssm-01.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | CreateImageRoleArn: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | TagKey: 11 | Type: String 12 | 13 | TagValue1: 14 | Type: String 15 | 16 | WaitForSuccessTimeoutSeconds: 17 | Type: Number 18 | 19 | 20 | Resources: 21 | CreateImageAssociation: 22 | Type: AWS::SSM::Association 23 | Properties: 24 | AssociationName: !Sub "${Prefix}-createimage-association" 25 | AutomationTargetParameterName: InstanceId 26 | Name: AWS-CreateImage 27 | Parameters: 28 | AutomationAssumeRole: 29 | - !Ref CreateImageRoleArn 30 | InstanceId: 31 | - "{{RESOURCE_ID}}" 32 | Targets: 33 | - Key: !Sub "tag:${TagKey}" 34 | Values: 35 | - !Ref TagValue1 36 | WaitForSuccessTimeoutSeconds: !Ref WaitForSuccessTimeoutSeconds 37 | -------------------------------------------------------------------------------- /017/fa-017-msad.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | MSADName: 5 | Type: String 6 | 7 | MSADPassword: 8 | Type: String 9 | 10 | Prefix: 11 | Type: String 12 | 13 | PrivateSubnet1: 14 | Type: String 15 | 16 | PrivateSubnet2: 17 | Type: String 18 | 19 | VPC: 20 | Type: String 21 | 22 | 23 | Resources: 24 | MSAD: 25 | Type: AWS::DirectoryService::MicrosoftAD 26 | Properties: 27 | Edition: Standard 28 | Name: !Ref MSADName 29 | Password: !Ref MSADPassword 30 | VpcSettings: 31 | SubnetIds: 32 | - !Ref PrivateSubnet1 33 | - !Ref PrivateSubnet2 34 | VpcId: !Ref VPC 35 | 36 | 37 | Outputs: 38 | MSAD: 39 | Value: !Ref MSAD 40 | 41 | MSADDnsIpAddress1: 42 | Value: !Select [0, !GetAtt MSAD.DnsIpAddresses] 43 | 44 | MSADDnsIpAddress2: 45 | Value: !Select [1, !GetAtt MSAD.DnsIpAddresses] -------------------------------------------------------------------------------- /034/cfn-templates/fa-034-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | PublicAccessBlockConfiguration: 14 | BlockPublicAcls: false 15 | BlockPublicPolicy: false 16 | IgnorePublicAcls: false 17 | RestrictPublicBuckets: false 18 | WebsiteConfiguration: 19 | IndexDocument: index.html 20 | 21 | BucketPolicy: 22 | Type: AWS::S3::BucketPolicy 23 | Properties: 24 | Bucket: !Ref Prefix 25 | PolicyDocument: 26 | Statement: 27 | Action: 28 | - s3:GetObject 29 | Effect: Allow 30 | Resource: 31 | - !Sub "arn:aws:s3:::${Bucket}/*" 32 | Principal: "*" 33 | 34 | 35 | Outputs: 36 | Bucket: 37 | Value: !Ref Bucket 38 | -------------------------------------------------------------------------------- /113/fa-113-eventbridge.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | EventBusName: 8 | Type: String 9 | 10 | Function4: 11 | Type: String 12 | 13 | Function4Arn: 14 | Type: String 15 | 16 | Prefix: 17 | Type: String 18 | 19 | 20 | Resources: 21 | EventsRule: 22 | Type: AWS::Events::Rule 23 | Properties: 24 | EventBusName: !Ref EventBusName 25 | EventPattern: 26 | source: 27 | - aws.s3 28 | Name: !Sub "${Prefix}-EventsRule" 29 | State: ENABLED 30 | Targets: 31 | - Arn: !Ref Function4Arn 32 | Id: !Ref Function4 33 | 34 | EventsRulePermission: 35 | Type: AWS::Lambda::Permission 36 | Properties: 37 | FunctionName: !Ref Function4 38 | Action: lambda:InvokeFunction 39 | Principal: events.amazonaws.com 40 | SourceArn: !GetAtt EventsRule.Arn 41 | -------------------------------------------------------------------------------- /105/fa-105-dynamodb.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | ReadCapacityUnits: 8 | Type: Number 9 | 10 | WriteCapacityUnits: 11 | Type: Number 12 | 13 | 14 | Resources: 15 | Table: 16 | Type: AWS::DynamoDB::Table 17 | Properties: 18 | AttributeDefinitions: 19 | - AttributeName: Artist 20 | AttributeType: S 21 | - AttributeName: SongTitle 22 | AttributeType: S 23 | BillingMode: PROVISIONED 24 | KeySchema: 25 | - AttributeName: Artist 26 | KeyType: HASH 27 | - AttributeName: SongTitle 28 | KeyType: RANGE 29 | ProvisionedThroughput: 30 | ReadCapacityUnits: !Ref ReadCapacityUnits 31 | WriteCapacityUnits: !Ref WriteCapacityUnits 32 | TableClass: STANDARD 33 | TableName: !Sub "${Prefix}-Music" 34 | 35 | 36 | Outputs: 37 | Table: 38 | Value: !Ref Table 39 | -------------------------------------------------------------------------------- /036/cfn-templates/fa-036-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | IndexHtml: 8 | Type: String 9 | 10 | 11 | Resources: 12 | S3Bucket: 13 | Type: AWS::S3::Bucket 14 | Properties: 15 | BucketName: !Ref Prefix 16 | AccessControl: Private 17 | WebsiteConfiguration: 18 | IndexDocument: !Ref IndexHtml 19 | 20 | BucketPolicy: 21 | Type: AWS::S3::BucketPolicy 22 | Properties: 23 | Bucket: !Ref Prefix 24 | PolicyDocument: 25 | Statement: 26 | Action: 27 | - s3:GetObject 28 | Effect: Allow 29 | Resource: 30 | !Sub "arn:aws:s3:::${S3Bucket}/*" 31 | Principal: "*" 32 | 33 | 34 | Outputs: 35 | BucketArn: 36 | Value: !GetAtt S3Bucket.Arn 37 | 38 | BucketWesSiteEndpointUrl: 39 | Value: !Sub "https://s3-ap-northeast-1.amazonaws.com/${S3Bucket}" -------------------------------------------------------------------------------- /043/fa-043.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-043 11 | 12 | 13 | Resources: 14 | LambdaStack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-lambda.yaml" 18 | Parameters: 19 | Handler: index.lambda_handler 20 | Prefix: !Ref Prefix 21 | Runtime: python3.8 22 | 23 | CustomResourceStack: 24 | Type: AWS::CloudFormation::Stack 25 | DependsOn: 26 | - LambdaStack 27 | Properties: 28 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-customresource.yaml" 29 | Parameters: 30 | FunctionArn: !GetAtt LambdaStack.Outputs.FunctionArn 31 | Prefix: !Ref Prefix 32 | -------------------------------------------------------------------------------- /126/fa-126-secretsmanager.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | PasswordKey: 5 | Type: String 6 | 7 | PasswordLength: 8 | Type: Number 9 | 10 | Prefix: 11 | Type: String 12 | 13 | 14 | Resources: 15 | Secret: 16 | Type: AWS::SecretsManager::Secret 17 | Properties: 18 | Description: test secret 19 | GenerateSecretString: 20 | ExcludeCharacters: "" 21 | ExcludeLowercase: false 22 | ExcludeNumbers: false 23 | ExcludePunctuation: false 24 | ExcludeUppercase: false 25 | GenerateStringKey: !Ref PasswordKey 26 | IncludeSpace: false 27 | PasswordLength: !Ref PasswordLength 28 | RequireEachIncludedType: true 29 | SecretStringTemplate: !Sub '{"${PasswordKey}": "hogehoge"}' 30 | KmsKeyId: alias/aws/secretsmanager 31 | Name: !Ref Prefix 32 | 33 | 34 | Outputs: 35 | Secret: 36 | Value: !Ref Secret 37 | -------------------------------------------------------------------------------- /012/cfn-templates/fa-012-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | IndexHtml: 8 | Type: String 9 | 10 | 11 | Resources: 12 | S3Bucket: 13 | Type: AWS::S3::Bucket 14 | Properties: 15 | BucketName: !Ref Prefix 16 | AccessControl: Private 17 | WebsiteConfiguration: 18 | IndexDocument: !Ref IndexHtml 19 | 20 | BucketPolicy: 21 | Type: AWS::S3::BucketPolicy 22 | Properties: 23 | Bucket: !Ref Prefix 24 | PolicyDocument: 25 | Statement: 26 | Action: 27 | - s3:GetObject 28 | Effect: Allow 29 | Resource: 30 | !Sub "arn:aws:s3:::${S3Bucket}/*" 31 | Principal: "*" 32 | 33 | 34 | Outputs: 35 | BucketArn: 36 | Value: !GetAtt S3Bucket.Arn 37 | 38 | BucketWesSiteEndpointUrl: 39 | Value: !Sub "https://s3-ap-northeast-1.amazonaws.com/${S3Bucket}" 40 | -------------------------------------------------------------------------------- /035/cfn-templates/fa-035-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | IndexHtml: 8 | Type: String 9 | 10 | 11 | Resources: 12 | S3Bucket: 13 | Type: AWS::S3::Bucket 14 | Properties: 15 | BucketName: !Ref Prefix 16 | AccessControl: Private 17 | WebsiteConfiguration: 18 | IndexDocument: !Ref IndexHtml 19 | 20 | BucketPolicy: 21 | Type: AWS::S3::BucketPolicy 22 | Properties: 23 | Bucket: !Ref Prefix 24 | PolicyDocument: 25 | Statement: 26 | Action: 27 | - s3:GetObject 28 | Effect: Allow 29 | Resource: 30 | !Sub "arn:aws:s3:::${S3Bucket}/*" 31 | Principal: "*" 32 | 33 | 34 | Outputs: 35 | BucketArn: 36 | Value: !GetAtt S3Bucket.Arn 37 | 38 | BucketWesSiteEndpointUrl: 39 | Value: !Sub "https://s3-ap-northeast-1.amazonaws.com/${S3Bucket}" 40 | -------------------------------------------------------------------------------- /165/fa-165-iot.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | AttributeName1: 5 | Type: String 6 | 7 | AttributeName2: 8 | Type: String 9 | 10 | AttributeName3: 11 | Type: String 12 | 13 | Prefix: 14 | Type: String 15 | 16 | 17 | Resources: 18 | Thing: 19 | Type: AWS::IoT::Thing 20 | Properties: 21 | AttributePayload: 22 | Attributes: 23 | id: 001 24 | ThingName: !Sub "${Prefix}-thing" 25 | 26 | ThingType: 27 | Type: AWS::IoT::ThingType 28 | Properties: 29 | DeprecateThingType: false 30 | ThingTypeName: !Sub "${Prefix}-type" 31 | ThingTypeProperties: 32 | SearchableAttributes: 33 | - !Ref AttributeName1 34 | - !Ref AttributeName2 35 | - !Ref AttributeName3 36 | ThingTypeDescription: test type 37 | 38 | 39 | Outputs: 40 | Thing: 41 | Value: !Ref Thing 42 | 43 | ThingType: 44 | Value: !Ref ThingType 45 | -------------------------------------------------------------------------------- /010/fa-010-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | S3Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | PublicAccessBlockConfiguration: 14 | BlockPublicAcls: false 15 | BlockPublicPolicy: false 16 | IgnorePublicAcls: false 17 | RestrictPublicBuckets: false 18 | WebsiteConfiguration: 19 | IndexDocument: index.html 20 | 21 | BucketPolicy: 22 | Type: AWS::S3::BucketPolicy 23 | Properties: 24 | Bucket: !Ref Prefix 25 | PolicyDocument: 26 | Statement: 27 | Action: 28 | - s3:GetObject 29 | Effect: Allow 30 | Resource: !Sub "arn:aws:s3:::${S3Bucket}/*" 31 | Principal: "*" 32 | 33 | 34 | Outputs: 35 | BucketWesSiteEndpointUrl: 36 | Value: !Sub "https://s3-ap-northeast-1.amazonaws.com/${S3Bucket}" 37 | -------------------------------------------------------------------------------- /062/fa-062-ssm.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | SQLParameter: 10 | Type: AWS::SSM::Parameter 11 | Properties: 12 | Name: !Ref Prefix 13 | Type: String 14 | Value: | 15 | CREATE database tutorial; 16 | USE tutorial; 17 | CREATE TABLE planet (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(30), PRIMARY KEY(id)); 18 | INSERT INTO planet (name) VALUES ("Mercury"); 19 | INSERT INTO planet (name) VALUES ("Venus"); 20 | INSERT INTO planet (name) VALUES ("Earth"); 21 | INSERT INTO planet (name) VALUES ("Mars"); 22 | INSERT INTO planet (name) VALUES ("Jupiter"); 23 | INSERT INTO planet (name) VALUES ("Saturn"); 24 | INSERT INTO planet (name) VALUES ("Uranus"); 25 | INSERT INTO planet (name) VALUES ("Neptune"); 26 | 27 | 28 | Outputs: 29 | SQLParameter: 30 | Value: !Ref SQLParameter -------------------------------------------------------------------------------- /113/fa-113-sns.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | BucketName: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | Topic: 13 | Type: AWS::SNS::Topic 14 | Properties: 15 | TopicName: !Sub "${Prefix}-Topic" 16 | 17 | TopicPolicy: 18 | Type: AWS::SNS::TopicPolicy 19 | Properties: 20 | PolicyDocument: 21 | Statement: 22 | - Action: 23 | - sns:Publish 24 | Condition: 25 | ArnLike: 26 | aws:SourceArn: !Sub "arn:aws:s3:::${BucketName}" 27 | StringEquals: 28 | aws:SourceAccount: !Ref AWS::AccountId 29 | Effect: Allow 30 | Resource: !Ref Topic 31 | Principal: 32 | Service: 33 | - s3.amazonaws.com 34 | Topics: 35 | - !Ref Topic 36 | 37 | 38 | Outputs: 39 | TopicArn: 40 | Value: !Ref Topic 41 | -------------------------------------------------------------------------------- /052/fa-052.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-052 11 | 12 | 13 | Resources: 14 | LambdaStack: 15 | Type: AWS::CloudFormation::Stack 16 | Properties: 17 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-lambda.yaml" 18 | Parameters: 19 | Architecture: arm64 20 | Handler: index.lambda_handler 21 | Prefix: !Ref Prefix 22 | Runtime: python3.8 23 | 24 | ApiGatewayStack: 25 | Type: AWS::CloudFormation::Stack 26 | DependsOn: 27 | - LambdaStack 28 | Properties: 29 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-apigateway.yaml" 30 | Parameters: 31 | FunctionArn: !GetAtt LambdaStack.Outputs.FunctionArn 32 | Prefix: !Ref Prefix 33 | -------------------------------------------------------------------------------- /020/fa-020-lambda1.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Handler: 5 | Type: String 6 | 7 | LambdaRoleArn: 8 | Type: String 9 | 10 | MemorySize: 11 | Type: Number 12 | 13 | Prefix: 14 | Type: String 15 | 16 | Runtime: 17 | Type: String 18 | 19 | S3Bucket: 20 | Type: String 21 | 22 | S3Key: 23 | Type: String 24 | 25 | SSMParameter: 26 | Type: String 27 | 28 | 29 | Resources: 30 | Function1: 31 | Type: AWS::Lambda::Function 32 | Properties: 33 | Code: 34 | S3Bucket: !Ref S3Bucket 35 | S3Key: !Ref S3Key 36 | Environment: 37 | Variables: 38 | ssm_parameter_name: !Ref SSMParameter 39 | region_name: !Ref AWS::Region 40 | FunctionName: !Sub ${Prefix}-function1 41 | Handler: !Ref Handler 42 | MemorySize: !Ref MemorySize 43 | PackageType: Zip 44 | Runtime: !Ref Runtime 45 | Role: !Ref LambdaRoleArn 46 | -------------------------------------------------------------------------------- /160/README.md: -------------------------------------------------------------------------------- 1 | # Notifying SNS using AWS IoT rules 2 | 3 | https://awstut.com/en/2024/08/31/notifying-sns-using-aws-iot-rules-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-160-diagram](https://github.com/user-attachments/assets/4aca0a54-0fa2-4022-b363-d6ddaae9d143) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-160.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-160/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-160 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-160/fa-160.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | -------------------------------------------------------------------------------- /022/fa-022-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | PrivateSubnet1: 14 | Type: String 15 | 16 | PrivateSubnet2: 17 | Type: String 18 | 19 | VPC: 20 | Type: String 21 | 22 | 23 | Resources: 24 | S3Endpoint: 25 | Type: AWS::EC2::VPCEndpoint 26 | Properties: 27 | PolicyDocument: 28 | Version: 2012-10-17 29 | Statement: 30 | - Effect: Allow 31 | Principal: '*' 32 | Action: 33 | - s3:GetObject 34 | Resource: 35 | - !Sub arn:aws:s3:::amazonlinux.${AWS::Region}.amazonaws.com/* 36 | - !Sub arn:aws:s3:::amazonlinux-2-repos-${AWS::Region}/* 37 | RouteTableIds: 38 | - !Ref PrivateRouteTable 39 | ServiceName: !Sub com.amazonaws.${AWS::Region}.s3 40 | VpcId: !Ref VPC -------------------------------------------------------------------------------- /095/README.md: -------------------------------------------------------------------------------- 1 | # Try EBS Multi-Attach 2 | 3 | https://awstut.com/en/2022/11/23/try-ebs-multi-attach-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-095-diagram](https://user-images.githubusercontent.com/84276199/204133342-617499ef-131a-46f4-8cdf-fb0da1650732.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-095.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-095/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-095 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-095/fa-095.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /102/fa-102-eventbridge.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EventBusName: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | TopicArn: 11 | Type: String 12 | 13 | TopicName: 14 | Type: String 15 | 16 | 17 | Resources: 18 | EventsRule: 19 | Type: AWS::Events::Rule 20 | Properties: 21 | EventBusName: !Ref EventBusName 22 | EventPattern: 23 | source: 24 | - !Ref Prefix 25 | Name: !Sub "${Prefix}-EventsRule" 26 | State: ENABLED 27 | Targets: 28 | - Arn: !Ref TopicArn 29 | Id: !Ref TopicName 30 | 31 | TopicPolicy: 32 | Type: AWS::SNS::TopicPolicy 33 | Properties: 34 | PolicyDocument: 35 | Statement: 36 | - Principal: 37 | Service: events.amazonaws.com 38 | Action: sns:Publish 39 | Effect: Allow 40 | Resource: !Ref TopicArn 41 | Topics: 42 | - !Ref TopicArn 43 | -------------------------------------------------------------------------------- /135/fa-135.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | TemplateBucketName: 5 | Type: String 6 | Default: [bucket-name] 7 | 8 | Prefix: 9 | Type: String 10 | Default: fa-135 11 | 12 | LambdaHandler: 13 | Type: String 14 | Default: index.lambda_handler 15 | 16 | LambdaMemory: 17 | Type: Number 18 | Default: 128 19 | 20 | LambdaRuntime: 21 | Type: String 22 | Default: python3.8 23 | 24 | Resources: 25 | StackSetsStack: 26 | Type: AWS::CloudFormation::Stack 27 | Properties: 28 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-stacksets.yaml" 29 | Parameters: 30 | LambdaHandler: !Ref LambdaHandler 31 | LambdaMemory: !Ref LambdaMemory 32 | LambdaRuntime: !Ref LambdaRuntime 33 | Prefix: !Ref Prefix 34 | TemplateURL: !Sub "https://${TemplateBucketName}.s3.${AWS::Region}.amazonaws.com/${Prefix}/${Prefix}-lambda.yaml" 35 | -------------------------------------------------------------------------------- /149/README.md: -------------------------------------------------------------------------------- 1 | # CodeBuild – Lambda Version 2 | 3 | https://awstut.com/en/2024/05/04/codebuild-lambda-version-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-149-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/64f9e26a-6392-4f22-918a-5111a6c16d8b) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-149.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-149/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-149 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-149/fa-149.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /098/fa-098-config.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ConfigBucket: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | DeliveryChannel: 13 | Type: AWS::Config::DeliveryChannel 14 | Properties: 15 | Name: !Sub "${Prefix}-DeliveryChannel" 16 | S3BucketName: !Ref ConfigBucket 17 | 18 | ConfigurationRecorder: 19 | Type: AWS::Config::ConfigurationRecorder 20 | Properties: 21 | Name: !Sub "${Prefix}-ConfigurationRecorder" 22 | RecordingGroup: 23 | AllSupported: false 24 | IncludeGlobalResourceTypes: false 25 | ResourceTypes: 26 | - AWS::S3::Bucket 27 | RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/config.amazonaws.com/${AWSServiceRoleForConfig}" 28 | 29 | AWSServiceRoleForConfig: 30 | Type: AWS::IAM::ServiceLinkedRole 31 | DeletionPolicy: Delete 32 | Properties: 33 | AWSServiceName: config.amazonaws.com 34 | -------------------------------------------------------------------------------- /100/README.md: -------------------------------------------------------------------------------- 1 | # Invoking Lambda from SNS 2 | 3 | https://awstut.com/en/2022/12/10/invoking-lambda-from-sns-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-100-diagram](https://user-images.githubusercontent.com/84276199/206803132-2472e529-d40f-46c0-8063-38a414867435.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-100.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-100/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-100 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-100/fa-100.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /103/fa-103-config.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | ConfigBucket: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | 11 | Resources: 12 | DeliveryChannel: 13 | Type: AWS::Config::DeliveryChannel 14 | Properties: 15 | Name: !Sub "${Prefix}-DeliveryChannel" 16 | S3BucketName: !Ref ConfigBucket 17 | 18 | ConfigurationRecorder: 19 | Type: AWS::Config::ConfigurationRecorder 20 | Properties: 21 | Name: !Sub "${Prefix}-ConfigurationRecorder" 22 | RecordingGroup: 23 | AllSupported: false 24 | IncludeGlobalResourceTypes: false 25 | ResourceTypes: 26 | - AWS::S3::Bucket 27 | RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/config.amazonaws.com/${AWSServiceRoleForConfig}" 28 | 29 | AWSServiceRoleForConfig: 30 | Type: AWS::IAM::ServiceLinkedRole 31 | DeletionPolicy: Delete 32 | Properties: 33 | AWSServiceName: config.amazonaws.com 34 | -------------------------------------------------------------------------------- /013/README.md: -------------------------------------------------------------------------------- 1 | # CloudFormation’s nested stack 2 | 3 | https://awstut.com/en/2021/12/11/cloudformations-nested-stack/ 4 | 5 | # Architecture 6 | 7 | ![fa-013-diagram](https://user-images.githubusercontent.com/84276199/189880066-1cc9b7de-3155-454e-958b-055a16e4b053.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-013.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-013/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-013 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-013/fa-013.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /111/README.md: -------------------------------------------------------------------------------- 1 | # RDS Read Replica using CFN 2 | 3 | https://awstut.com/en/2023/01/09/rds-read-replica-using-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-111-diagram](https://user-images.githubusercontent.com/84276199/211221936-b5216aa0-3705-4eee-9101-5d213d9558f8.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-111.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-111/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-111 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-111/fa-111.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /008/README.md: -------------------------------------------------------------------------------- 1 | # Attaching EBS to Linux Instance 2 | 3 | https://awstut.com/en/2021/12/12/attaching-ebs-to-linux-instance/ 4 | 5 | # Architecture 6 | 7 | ![fa-008-diagram](https://user-images.githubusercontent.com/84276199/188453415-a6572913-d712-4bb7-a5d5-1fb63bbf5854.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-008.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-008/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-008 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-008/fa-008.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /023/fa-023-endpoint.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | EndpointSecurityGroup: 5 | Type: String 6 | 7 | Prefix: 8 | Type: String 9 | 10 | PrivateRouteTable: 11 | Type: String 12 | 13 | PrivateSubnet1: 14 | Type: String 15 | 16 | PrivateSubnet2: 17 | Type: String 18 | 19 | VPC: 20 | Type: String 21 | 22 | 23 | Resources: 24 | S3Endpoint: 25 | Type: AWS::EC2::VPCEndpoint 26 | Properties: 27 | PolicyDocument: 28 | Version: 2012-10-17 29 | Statement: 30 | - Effect: Allow 31 | Principal: '*' 32 | Action: 33 | - s3:GetObject 34 | Resource: 35 | - !Sub "arn:aws:s3:::amazonlinux.${AWS::Region}.amazonaws.com/*" 36 | - !Sub "arn:aws:s3:::amazonlinux-2-repos-${AWS::Region}/*" 37 | RouteTableIds: 38 | - !Ref PrivateRouteTable 39 | ServiceName: !Sub "com.amazonaws.${AWS::Region}.s3" 40 | VpcId: !Ref VPC 41 | -------------------------------------------------------------------------------- /058/README.md: -------------------------------------------------------------------------------- 1 | # Aurora Serverless with CFN 2 | 3 | https://awstut.com/en/2022/06/04/apply-waf-web-acl-to-api-gateway-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-058-diagram](https://user-images.githubusercontent.com/84276199/204084530-3c6ff723-0618-4ab7-b102-1e8119da44da.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-058.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-058/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-058 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-058/fa-058.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /002/README.md: -------------------------------------------------------------------------------- 1 | # Dnf/Yum on private subnet instances 2 | 3 | https://awstut.com/en/2021/12/11/run-yum-on-a-private-subnet-instance/ 4 | 5 | # Architecture 6 | 7 | ![fa-002-diagram](https://user-images.githubusercontent.com/84276199/188271580-46529129-534f-437a-b36c-0bb905c99d7c.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-002.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-002/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-002 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-002/fa-002.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /090/README.md: -------------------------------------------------------------------------------- 1 | # Fargate Spot in CloudFormation 2 | 3 | https://awstut.com/en/2022/10/16/fargate-spot-in-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-090-diagram](https://user-images.githubusercontent.com/84276199/204132094-5a61b15e-aeec-49a1-b957-4a82b99a54ec.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-089.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-090/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-090 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-090/fa-090.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /053/README.md: -------------------------------------------------------------------------------- 1 | # Apply WAF Web ACL to API Gateway 2 | 3 | https://awstut.com/en/2022/06/04/apply-waf-web-acl-to-api-gateway-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-053-diagram](https://user-images.githubusercontent.com/84276199/202889403-08357f4b-dda7-494a-98e2-a5671826883d.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-053.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-053/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-053 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-053/fa-053.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /110/README.md: -------------------------------------------------------------------------------- 1 | # RDS Multi-AZ deployment using CFN 2 | 3 | https://awstut.com/en/2023/01/05/rds-multi-az-deployment-using-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-110-diagram](https://user-images.githubusercontent.com/84276199/210733565-611f1f49-627f-4cb9-8109-b60f4287a6f4.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-110.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-110/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-110 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-110/fa-110.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /112/README.md: -------------------------------------------------------------------------------- 1 | # Multi-AZ DB Cluster RDS Using CFN 2 | 3 | https://awstut.com/en/2023/01/14/multi-az-db-cluster-rds-using-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-112-diagram](https://user-images.githubusercontent.com/84276199/212431600-8d37c307-e72c-4bb0-8321-881c0b638fa1.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-112.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-112/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-112 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-112/fa-112.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /009/README.md: -------------------------------------------------------------------------------- 1 | # Four ways to attach EBS to Windows instance 2 | 3 | https://awstut.com/en/2021/12/12/attaching-ebs-to-a-windows-instance/ 4 | 5 | # Architecture 6 | 7 | ![fa-009-diagram](https://user-images.githubusercontent.com/84276199/188455268-c8e2394e-9aee-447f-8dfa-83f0ecd4c082.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-009.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-009/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-009 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-009/fa-009.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /132/README.md: -------------------------------------------------------------------------------- 1 | # Restrict access to ALB to via CloudFront 2 | 3 | https://awstut.com/en/2023/06/11/restrict-access-to-alb-to-via-cloudfront-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-132-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/2fa5b31d-af3c-43e5-8943-87c37cf315e4) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-132.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-132/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-132 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-132/fa-132.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /150/README.md: -------------------------------------------------------------------------------- 1 | # Execute CodeBuild within Step Functions 2 | 3 | https://awstut.com/en/2024/05/05/execute-codebuild-within-step-functions-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-150-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/17b71075-ae25-4127-b7b3-18f3a6a8144b) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-150.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-150/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-150 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-150/fa-150.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /001/README.md: -------------------------------------------------------------------------------- 1 | # Attach instances in private subnet to ELB 2 | 3 | https://awstut.com/en/2021/12/11/attaching-instances-in-private-subnet-to-elb/ 4 | 5 | # Architecture 6 | 7 | ![fa-001-diagram](https://user-images.githubusercontent.com/84276199/188146332-4695ffb2-1ee1-4e9c-89ab-2d8f8ea5a672.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-001.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-001/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-001 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-001/fa-001.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /067/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to SNS with CFN – email version 2 | 3 | https://awstut.com/en/2022/07/30/introduction-to-sns-with-cfn-email-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-067-diagram](https://user-images.githubusercontent.com/84276199/204088638-89bf21b0-4ff2-43a7-93e7-f7c87bfab9c0.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-067.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-067/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-067 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-067/fa-067.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /121/README.md: -------------------------------------------------------------------------------- 1 | # Iteration using Map in Step Functions 2 | 3 | https://awstut.com/en/2023/03/12/iteration-using-map-in-step-functions-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-121-diagram](https://user-images.githubusercontent.com/84276199/224534490-fd633977-56e3-488b-a52e-5fdade254d25.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-121.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-121/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-121 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-121/fa-121.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /133/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to Amplify with CloudFormation 2 | 3 | https://awstut.com/en/2023/06/17/introduction-to-amplify-with-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-133-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/c6e83b70-79c1-4787-94c1-8af0dc05c997) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-133.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-133/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-133 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-133/fa-133.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /135/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to CloudFormation StackSets 2 | 3 | https://awstut.com/en/2023/07/08/introduction-to-cloudformation-stacksets-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-135-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/a0033aed-f32d-481a-9a8b-21da5d082fe8) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-135.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-135/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-135 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-135/fa-135.yaml \ 39 | --capabilities CAPABILITY_NAMED_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /158/README.md: -------------------------------------------------------------------------------- 1 | # Create AWS IoT rules and republish MQTT messages 2 | 3 | https://awstut.com/en/2024/08/03/create-aws-iot-rules-and-republish-mqtt-messages-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-158-diagram](https://github.com/user-attachments/assets/189d7702-32a2-48c2-adf6-d287c9be390a) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-158.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-158/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-158 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-158/fa-158.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /003/README.md: -------------------------------------------------------------------------------- 1 | # Accessing Linux instance via SSM Session Manager 2 | 3 | https://awstut.com/en/2021/12/11/accessing-a-linux-instance-via-ssm-session-manager/ 4 | 5 | # Architecture 6 | 7 | ![fa-003-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/42540b90-56ed-4adc-a46d-5ad53bb5007a) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-003.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-003/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-003 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-003/fa-003.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /014/README.md: -------------------------------------------------------------------------------- 1 | # Deliver VPC Flow Logs to S3/CloudWatch Logs 2 | 3 | https://awstut.com/en/2021/12/25/deliver-vpc-flow-logs-to-s3-cloudwatch-logs/ 4 | 5 | # Architecture 6 | 7 | ![fa-014-diagram](https://user-images.githubusercontent.com/84276199/190858740-7d00064f-a159-4e15-bc04-193f63cae471.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-014.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-014/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-014 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-014/fa-014.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /046/README.md: -------------------------------------------------------------------------------- 1 | # Geographic Restrictions using WAF Web ACL 2 | 3 | https://awstut.com/en/2022/05/07/geographic-restrictions-using-waf-web-acl-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-046-diagram](https://user-images.githubusercontent.com/84276199/201520878-172f850e-b082-4235-a7c7-064be9556301.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-046.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-046/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-046 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-046/fa-046.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /114/README.md: -------------------------------------------------------------------------------- 1 | # Triggering Lambda function from SQS queue 2 | 3 | https://awstut.com/en/2023/01/22/triggering-lambda-function-from-sqs-queue-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-114-diagram](https://user-images.githubusercontent.com/84276199/213912509-9f557e57-9a7f-4bc0-a4ef-6ea174945d8e.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-104.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-104/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-104 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-104/fa-104.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /131/README.md: -------------------------------------------------------------------------------- 1 | # Use AWS Config to detect outdated access keys 2 | 3 | https://awstut.com/en/2023/05/13/use-aws-config-to-detect-outdated-access-keys-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-131-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/49a55f7f-9f82-484b-9943-9db684444d9d) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-131.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-131/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-131 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-131/fa-131.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /161/README.md: -------------------------------------------------------------------------------- 1 | # How to Save MQTT Messages to DynamoDB Using AWS IoT Rules 2 | 3 | https://awstut.com/en/2024/10/14/how-to-save-mqtt-messages-to-dynamodb-using-aws-iot-rules-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-161-diagram](https://github.com/user-attachments/assets/944fc46c-4a26-4a07-a033-30ed733b8d1f) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-161.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-161/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-161 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-161/fa-161.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | -------------------------------------------------------------------------------- /050/README.md: -------------------------------------------------------------------------------- 1 | # S3 content delivery via CloudFront – OAI ver 2 | 3 | https://awstut.com/en/2022/05/16/s3-content-delivery-via-cloudfront-oai-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-050-diagram-01](https://user-images.githubusercontent.com/84276199/202888808-b0ea7d1f-d48d-415b-a1fb-3e5a722cebd6.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-050.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-050/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-050 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-050/fa-050.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /051/README.md: -------------------------------------------------------------------------------- 1 | # Apply WAF Web ACL to CloudFront 2 | 3 | https://awstut.com/en/2022/05/22/apply-waf-web-acl-to-cloudfront-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-051-diagram](https://user-images.githubusercontent.com/84276199/202888997-cce27a0f-fb8d-428c-a612-405291b43dd9.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-051.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-051/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-051 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-051/fa-051.yaml \ 39 | --capabilities CAPABILITY_IAM \ 40 | --region us-east-1 41 | ``` 42 | -------------------------------------------------------------------------------- /080/README.md: -------------------------------------------------------------------------------- 1 | # Setup Approval Action in CodePipeline 2 | 3 | https://awstut.com/en/2022/09/03/setup-approval-action-in-codepipeline-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-080-diagram](https://user-images.githubusercontent.com/84276199/204129829-9fb40a94-e137-47cf-a371-ee4b65356aab.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-080.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp ./templates s3://my-bucket/fa-080/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-080 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-080/fa-080.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /081/README.md: -------------------------------------------------------------------------------- 1 | # Setting up Test Units in CodePipeline 2 | 3 | https://awstut.com/en/2022/09/18/setting-up-test-units-in-codepipeline-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-081-diagram](https://user-images.githubusercontent.com/84276199/204130068-d43c5947-e511-4766-83b9-4abdb37d9103.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-081.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp ./templates s3://my-bucket/fa-081/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-081 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-081/fa-081.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /083/README.md: -------------------------------------------------------------------------------- 1 | # Enable image scanning at ECR registry level 2 | 3 | https://awstut.com/en/2022/09/23/enable-image-scanning-at-ecr-registry-level-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-083-diagram](https://user-images.githubusercontent.com/84276199/204130352-d0ec6e7c-d047-4e07-9733-2889a4193c3b.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-083.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-083/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-083 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-083/fa-083.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /096/README.md: -------------------------------------------------------------------------------- 1 | # Deliver S3 content via CloudFront using OAC 2 | 3 | https://awstut.com/en/2022/11/27/deliver-s3-content-via-cloudfront-using-oac-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-096-diagram](https://user-images.githubusercontent.com/84276199/204127626-8c48c3c0-279e-478b-820b-c87e4ad79d3f.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-096.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-096/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-096 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-096/fa-096.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /098/README.md: -------------------------------------------------------------------------------- 1 | # Check resource change history in AWS Config 2 | 3 | https://awstut.com/en/2022/12/04/check-resource-change-history-in-aws-config-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-098-diagram](https://user-images.githubusercontent.com/84276199/205490860-349e92af-dae9-4208-8a00-d615fa0627ce.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-098.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-098/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-098 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-098/fa-098.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /108/README.md: -------------------------------------------------------------------------------- 1 | # S3 Lifecycle Rules – Delete expired objects 2 | 3 | https://awstut.com/en/2023/01/03/s3-lifecycle-rules-delete-expired-objects-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-108-diagram](https://user-images.githubusercontent.com/84276199/210352133-90791c21-91ff-45a1-bf1f-6d580c96dd55.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-108.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-108/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-108 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-108/fa-108.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /136/README.md: -------------------------------------------------------------------------------- 1 | # Backup to S3 every time you push to CodeCommit 2 | 3 | https://awstut.com/en/2023/07/15/backup-to-s3-every-time-you-push-to-codecommit-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-136-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/7433c3a7-2b1b-4ddd-a60c-4f39b3d59a50) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-136.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-136/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-136 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-136/fa-136.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /005/README.md: -------------------------------------------------------------------------------- 1 | # Serverless apps using Lambda and API Gateway – HTTP API 2 | 3 | https://awstut.com/en/2021/12/11/serverless-apps-using-lambda-and-api-gateway/ 4 | 5 | # Architecture 6 | 7 | ![fa-005-diagram](https://user-images.githubusercontent.com/84276199/188431936-6c90d2a0-0bb3-49c7-abe7-cf83ec95b65e.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-005.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-005/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-005 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-005/fa-005.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /015/README.md: -------------------------------------------------------------------------------- 1 | # Install CloudWatch Agent on Linux and collect data 2 | 3 | https://awstut.com/en/2021/12/28/install-cloudwatch-agent-on-linux-and-collect-data/ 4 | 5 | # Architecture 6 | 7 | ![fa-015-diagram](https://user-images.githubusercontent.com/84276199/190858871-2f465fe2-8be1-4214-8472-fc997ff4f4f9.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-015.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-015/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-015 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-015/fa-015.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /021/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to SQS Data Linkage between Lambdas 2 | 3 | https://awstut.com/en/2022/02/05/introduction-to-sqs-data-linkage-between-lambdas-2/ 4 | 5 | # Architecture 6 | 7 | ![fa-021-diagram](https://user-images.githubusercontent.com/84276199/191960392-c05af5f6-97e2-4713-9575-c9321c419a8f.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-021.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-021/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-021 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-021/fa-021.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /028/README.md: -------------------------------------------------------------------------------- 1 | # Three target types of ALB (Instance, IP, Lambda) and Auto Scaling 2 | 3 | https://awstut.com/en/2022/02/26/three-target-types-of-alb-2/ 4 | 5 | # Architecture 6 | 7 | ![fa-028-diagram](https://user-images.githubusercontent.com/84276199/200163402-006daca3-0bf6-4de2-9af7-95bd936f7558.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-028.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-028/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-028 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-028/fa-028.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /030/README.md: -------------------------------------------------------------------------------- 1 | # Scaling based on custom metrics (memory) – Linux 2 | 3 | https://awstut.com/en/2022/03/05/scaling-based-on-custom-metrics-memory-linux/ 4 | 5 | # Architecture 6 | 7 | ![fa-030-diagram](https://user-images.githubusercontent.com/84276199/200165060-1551caaf-3f0d-4de6-9a99-04e3dbad6908.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-030.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-030/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-030 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-030/fa-030.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /048/fa-048-s3.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | Prefix: 5 | Type: String 6 | 7 | 8 | Resources: 9 | Bucket: 10 | Type: AWS::S3::Bucket 11 | Properties: 12 | BucketName: !Ref Prefix 13 | PublicAccessBlockConfiguration: 14 | BlockPublicAcls: false 15 | BlockPublicPolicy: false 16 | IgnorePublicAcls: false 17 | RestrictPublicBuckets: false 18 | WebsiteConfiguration: 19 | IndexDocument: index.html 20 | 21 | BucketPolicy: 22 | Type: AWS::S3::BucketPolicy 23 | Properties: 24 | Bucket: !Ref Bucket 25 | PolicyDocument: 26 | Statement: 27 | Action: 28 | - s3:GetObject 29 | Effect: Allow 30 | Resource: !Sub "arn:aws:s3:::${Bucket}/*" 31 | Principal: "*" 32 | 33 | 34 | Outputs: 35 | BucketArn: 36 | Value: !GetAtt Bucket.Arn 37 | 38 | BucketWebsiteURL: 39 | Value: !GetAtt Bucket.WebsiteURL 40 | 41 | BucketName: 42 | Value: !Ref Bucket 43 | -------------------------------------------------------------------------------- /082/README.md: -------------------------------------------------------------------------------- 1 | # Enable image scanning at ECR repository level 2 | 3 | https://awstut.com/en/2022/09/19/enable-image-scanning-at-ecr-repository-level-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-082-diagram](https://user-images.githubusercontent.com/84276199/204130175-d091f85c-8575-4c4c-aa2c-196230c46f60.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-082.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-082/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-082 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-082/fa-082.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /107/README.md: -------------------------------------------------------------------------------- 1 | # Enable DynamoDB expiration time (TTL) using CFN 2 | 3 | https://awstut.com/en/2022/12/31/enable-dynamodb-expiration-time-ttl-using-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-107-diagram](https://user-images.githubusercontent.com/84276199/210116903-90d4fff5-15b1-4758-9e74-6ed99eed6dd1.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-107.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-107/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-107 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-107/fa-107.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /138/README.md: -------------------------------------------------------------------------------- 1 | # Aurora Serverless v2 creation using CloudFormation 2 | 3 | https://awstut.com/en/2023/08/05/aurora-serverless-v2-creation-using-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-138-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/586a517f-50b9-416e-8e6d-38537ed26644) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-138.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-138/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-138 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-138/fa-138.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /151/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to AWS IoT Core using CloudFormation 2 | 3 | https://awstut.com/en/2024/03/02/introduction-to-aws-iot-core-using-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-151-diagram](https://github.com/awstut-an-r/awstut-fa/assets/84276199/a2d605a3-0b41-4722-aa95-09e73a94f3e6) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-151.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-151/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-151 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-151/fa-151.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /007/README.md: -------------------------------------------------------------------------------- 1 | # Accessing Windows instance via SSM Session Manager 2 | 3 | https://awstut.com/en/2021/12/11/accessing-a-windows-instance-via-ssm-session-manager/ 4 | 5 | # Architecture 6 | 7 | ![fa-007-diagram](https://user-images.githubusercontent.com/84276199/188451006-049e1f72-a340-4458-8f92-1a5b4517e0ff.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-007.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-007/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-007 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-007/fa-007.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /016/README.md: -------------------------------------------------------------------------------- 1 | # Install CloudWatch Agent on Windows and collect data 2 | 3 | https://awstut.com/en/2021/12/28/install-cloudwatch-agent-on-windows-and-collect-data/ 4 | 5 | # Architecture 6 | 7 | ![fa-016-diagram](https://user-images.githubusercontent.com/84276199/190859401-94d37df6-7b89-4c81-a8ca-fadf5eefa623.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-016.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: my-bucket 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-016/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-016 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-016/fa-016.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /033/README.md: -------------------------------------------------------------------------------- 1 | # Amazon Linux 2 How to Connect to RDS – ALL Engines 2 | 3 | https://awstut.com/en/2022/03/21/amazon-linux-2-how-to-connect-to-rds-all-engines/ 4 | 5 | # Architecture 6 | 7 | ![fa-033-diagram](https://user-images.githubusercontent.com/84276199/200166104-eb8d2d6e-acdb-48ed-a7b0-b889405c5727.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-033.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-033/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-033 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-033/fa-033.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /038/README.md: -------------------------------------------------------------------------------- 1 | # Lambda Function URL by CFN – Auth Type: NONE 2 | 3 | https://awstut.com/en/2022/04/24/lambda-function-url-by-cloudformation-auth-type-none-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-038-diagram](https://user-images.githubusercontent.com/84276199/200168574-5be7b034-8d6b-41bb-9bdf-57e294f82607.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-038.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-038/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-038 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-038/fa-038.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /043/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to CloudFormation Custom Resources 2 | 3 | https://awstut.com/en/2022/05/04/introduction-to-cloudformation-custom-resources-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-043-diagram](https://user-images.githubusercontent.com/84276199/201472125-ab67b6a6-7490-493d-aeb0-46493af28b95.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-043.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-043/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-043 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-043/fa-043.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /045/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to WAF Web ACL with CNF – ALB Ver. 2 | 3 | https://awstut.com/en/2022/05/06/introduction-to-waf-web-acl-with-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-045-diagram](https://user-images.githubusercontent.com/84276199/201519835-ec643df4-3680-4f1e-9816-2f4450eb1f2d.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-045.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-045/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-045 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-045/fa-045.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /052/README.md: -------------------------------------------------------------------------------- 1 | # Create REST API type API Gateway using CFN 2 | 3 | https://awstut.com/en/2022/05/22/create-rest-api-type-api-gateway-using-cloudformation-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-052-diagram](https://user-images.githubusercontent.com/84276199/202889218-d2bfa713-fec2-4873-8910-03a24cb4f6d2.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-052.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-052/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-052 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-052/fa-052.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /085/README.md: -------------------------------------------------------------------------------- 1 | # Introduction to ECR Repository Policies Using CFN 2 | 3 | https://awstut.com/en/2022/09/24/introduction-to-ecr-repository-policies-using-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-085-diagram](https://user-images.githubusercontent.com/84276199/204131589-8a946ae1-7264-460a-9659-a2e5650d804c.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-085.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-085/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-085 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-085/fa-085.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | -------------------------------------------------------------------------------- /109/README.md: -------------------------------------------------------------------------------- 1 | # Create S3 bucket with versioning enabled with CFN 2 | 3 | https://awstut.com/en/2023/01/04/create-s3-bucket-with-versioning-enabled-with-cfn-en/ 4 | 5 | # Architecture 6 | 7 | ![fa-109-diagram](https://user-images.githubusercontent.com/84276199/210449556-e20a5f61-71b0-4222-bab4-97fbe9c2431d.png) 8 | 9 | # Requirements 10 | 11 | * AWS CLI 12 | * S3 Bucket(Here, the bucket name is *my-bucket* and region is *ap-northeast-1*) 13 | 14 | # Usage 15 | 16 | ## Tempalte File Modification 17 | 18 | Modify the following locations in fa-109.yaml. 19 | 20 | ```yaml 21 | Parameters: 22 | TemplateBucketName: 23 | Type: String 24 | Default: [bucket-name] 25 | ``` 26 | 27 | ## Upload Template Files to S3 Bucket 28 | 29 | ```bash 30 | aws s3 cp . s3://my-bucket/fa-109/ --recursive 31 | ``` 32 | 33 | ## CloudFormation Stack Creation 34 | 35 | ```bash 36 | aws cloudformation create-stack \ 37 | --stack-name fa-109 \ 38 | --template-url https://my-bucket.s3.ap-northeast-1.amazonaws.com/fa-109/fa-109.yaml \ 39 | --capabilities CAPABILITY_IAM 40 | ``` 41 | --------------------------------------------------------------------------------