Skip to content

Commit b40e505

Browse files
authored
Merge pull request #11 from tanakaryo/add-feature-cf
#10 add new resource.
2 parents 85d5c11 + 85f3fa7 commit b40e505

File tree

8 files changed

+80
-0
lines changed

8 files changed

+80
-0
lines changed

infrastructure-as-code/.DS_Store

6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Architecture
2+
#### this simple architecture for cloudformation starting up.
3+
![architecture](./aws-archi1.drawio.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<mxfile host="app.diagrams.net" modified="2024-06-23T19:21:25.344Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" etag="6jDsBANctzm9ewCmjw18" version="24.6.2" type="device">
2+
<diagram name="ページ1" id="EsSA6SOzazF9kZatQ42t">
3+
<mxGraphModel dx="1350" dy="713" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="PP3JoJSjijkOAGgl-4jN-1" value="VPC" style="points=[[0,0],[0.25,0],[0.5,0],[0.75,0],[1,0],[1,0.25],[1,0.5],[1,0.75],[1,1],[0.75,1],[0.5,1],[0.25,1],[0,1],[0,0.75],[0,0.5],[0,0.25]];outlineConnect=0;gradientColor=none;html=1;whiteSpace=wrap;fontSize=12;fontStyle=0;container=1;pointerEvents=0;collapsible=0;recursiveResize=0;shape=mxgraph.aws4.group;grIcon=mxgraph.aws4.group_vpc2;strokeColor=#8C4FFF;fillColor=none;verticalAlign=top;align=left;spacingLeft=30;fontColor=#AAB7B8;dashed=0;" vertex="1" parent="1">
8+
<mxGeometry x="180" y="190" width="300" height="240" as="geometry" />
9+
</mxCell>
10+
<mxCell id="PP3JoJSjijkOAGgl-4jN-2" value="Subnet" style="sketch=0;outlineConnect=0;gradientColor=none;html=1;whiteSpace=wrap;fontSize=12;fontStyle=0;shape=mxgraph.aws4.group;grIcon=mxgraph.aws4.group_subnet;strokeColor=#879196;fillColor=none;verticalAlign=top;align=left;spacingLeft=30;fontColor=#879196;dashed=0;" vertex="1" parent="1">
11+
<mxGeometry x="230" y="230" width="220" height="170" as="geometry" />
12+
</mxCell>
13+
<mxCell id="PP3JoJSjijkOAGgl-4jN-3" value="Amazon EC2" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#ffffff;fillColor=#232F3E;dashed=0;verticalLabelPosition=middle;verticalAlign=bottom;align=center;html=1;whiteSpace=wrap;fontSize=10;fontStyle=1;spacing=3;shape=mxgraph.aws4.productIcon;prIcon=mxgraph.aws4.ec2;" vertex="1" parent="1">
14+
<mxGeometry x="290" y="270" width="80" height="100" as="geometry" />
15+
</mxCell>
16+
</root>
17+
</mxGraphModel>
18+
</diagram>
19+
</mxfile>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"yaml.schemas": {
3+
"https://raw.githubusercontent.com/aws/serverless-application-model/main/samtranslator/schema/schema.json": "file:///Users/yoichiikegawa/Documents/Github/aws/infrastructure-as-code/cloudformation/apps/app1/create-ec2-network-simple/template.yaml"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
AWSTemplateFormatVersion: '2010-09-09'
2+
Description: Simple Template
3+
4+
## Parameters
5+
Parameters:
6+
InstanceType:
7+
Description: EC2 Instance Types.
8+
Type: String
9+
Default: t2.micro
10+
AllowedValues:
11+
- t2.micro
12+
- t2.small
13+
- t2.medium
14+
15+
## Resources.
16+
### vpc
17+
Resources:
18+
simpleVpc:
19+
Type: AWS::EC2::VPC
20+
Properties:
21+
CidrBlock: '192.168.0.0/16'
22+
Tags:
23+
- Key: 'Name'
24+
Value: 'simple-vpc'
25+
26+
### subnet
27+
simpleSubnet:
28+
Type: AWS::EC2::Subnet
29+
Properties:
30+
CidrBlock: '192.168.1.0/24'
31+
MapPublicIpOnLaunch: false
32+
Tags:
33+
- Key: 'Name'
34+
Value: 'simple-subnet'
35+
VpcId: !Ref simpleVpc
36+
37+
### ec2
38+
simpleEC2Instance:
39+
Type: AWS::EC2::Instance
40+
Properties:
41+
SubnetId: !Ref simpleSubnet
42+
ImageId: "ami-0595d6e81396a9efb"
43+
InstanceType: !Ref InstanceType
44+
BlockDeviceMappings:
45+
- DeviceName: '/dev/xvda'
46+
Ebs:
47+
VolumeType: 'gp2'
48+
VolumeSize: 8
49+
Tags:
50+
- Value: 'simple-ec2-instance'
51+
Key: 'Name'
52+
53+
6 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)