-
Notifications
You must be signed in to change notification settings - Fork 246
Expand file tree
/
Copy pathWorkingCFN.yaml
More file actions
155 lines (153 loc) · 4.5 KB
/
WorkingCFN.yaml
File metadata and controls
155 lines (153 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
VPC:
Type: AWS::EC2::VPC::Id
Description: The ID for the VPC in which the EC2 instance will be launched.
Subnet:
Type: AWS::EC2::Subnet::Id
Description: The ID for the Subnet in which the EC2 instance will be launched.
Resources:
SampleInstanceProfileRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: ''
Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Action: sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier
XRayWriteOnlyPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: AWSXRayWriteOnlyAccess
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- sns:Publish
- xray:PutTelemetryRecords
- xray:PutTraceSegments
- dynamodb:PutItem
Resource:
- "*"
Roles:
- Ref: SampleInstanceProfileRole
SampleInstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Path: "/"
Roles:
- Ref: SampleInstanceProfileRole
SampleEBServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: ''
Effect: Allow
Principal:
Service: elasticbeanstalk.amazonaws.com
Action: sts:AssumeRole
Condition:
StringEquals:
sts:ExternalId: elasticbeanstalk
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkService
- arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkEnhancedHealth
ElasticBeanstalkApplication:
Type: AWS::ElasticBeanstalk::Application
Properties:
ApplicationName:
Ref: AWS::StackName
ElasticBeanstalkApplicationVersion:
Type: AWS::ElasticBeanstalk::ApplicationVersion
Properties:
ApplicationName:
Ref: ElasticBeanstalkApplication
SourceBundle:
S3Bucket:
Fn::Join:
- "."
- - aws-xray-assets
- Ref: AWS::Region
S3Key: samples/aws-xray-node-sample-app.zip
ElasticBeanstalkEnvironment:
Type: AWS::ElasticBeanstalk::Environment
Properties:
ApplicationName:
Ref: ElasticBeanstalkApplication
Description: AWS X-Ray Getting Started Sample Application
EnvironmentName:
Ref: AWS::StackName
OptionSettings:
- Namespace: aws:autoscaling:launchconfiguration
OptionName: InstanceType
Value: t3.large
- Namespace: aws:autoscaling:launchconfiguration
OptionName: IamInstanceProfile
Value:
Ref: SampleInstanceProfile
- Namespace: aws:elasticbeanstalk:environment
OptionName: ServiceRole
Value:
Ref: SampleEBServiceRole
- Namespace: aws:elasticbeanstalk:environment
OptionName: EnvironmentType
Value: SingleInstance
- Namespace: aws:elasticbeanstalk:healthreporting:system
OptionName: SystemType
Value: enhanced
-
Namespace: "aws:ec2:vpc"
OptionName: AssociatePublicIpAddress
Value: true
-
Namespace: "aws:ec2:vpc"
OptionName: ELBSubnets
Value: !Ref Subnet
-
Namespace: "aws:ec2:vpc"
OptionName: Subnets
Value: !Ref Subnet
-
Namespace: "aws:ec2:vpc"
OptionName: VPCId
Value: !Ref VPC
PlatformArn:
Fn::Join:
- ":"
- - arn:aws:elasticbeanstalk
- Ref: AWS::Region
- :platform/Node.js 16 running on 64bit Amazon Linux 2/5.6.2
VersionLabel:
Ref: ElasticBeanstalkApplicationVersion
Outputs:
ElasticBeanstalkEnvironmentURL:
Description: URL for the Elastic Beanstalk Getting Started Sample Application
Value:
Fn::GetAtt:
- ElasticBeanstalkEnvironment
- EndpointURL
SampleInstanceProfileRole:
Description: IAM Role used for AWS X-Ray Getting Started Sample Application
Value:
Fn::GetAtt:
- SampleInstanceProfileRole
- Arn
SampleInstanceProfile:
Description: Instance Profile used for AWS X-Ray Getting Started Sample Application
Value:
Ref: SampleInstanceProfile
SampleEBServiceRole:
Description: IAM Role used for AWS Elastic Beanstalk Service Role
Value:
Fn::GetAtt:
- SampleEBServiceRole
- Arn