@@ -482,6 +482,13 @@ Resources:
482
482
- " ssmmessages:OpenDataChannel"
483
483
Effect : Allow
484
484
Resource : " *"
485
+ - Action :
486
+ - " logs:CreateLogStream"
487
+ - " logs:PutLogEvents"
488
+ - " logs:DescribeLogGroups"
489
+ - " logs:DescribeLogStreams"
490
+ Effect : Allow
491
+ Resource : " *"
485
492
{{ if eq .Cluster.Environment "e2e" }}
486
493
# Add extra permissions to worker IAM role to test that if a pod manages to get
487
494
# the WorkerIAMRole assigned it can list a specific s3 bucket.
@@ -1417,6 +1424,13 @@ Resources:
1417
1424
- " ssmmessages:OpenDataChannel"
1418
1425
Effect : Allow
1419
1426
Resource : " *"
1427
+ - Action :
1428
+ - " logs:CreateLogStream"
1429
+ - " logs:PutLogEvents"
1430
+ - " logs:DescribeLogGroups"
1431
+ - " logs:DescribeLogStreams"
1432
+ Effect : Allow
1433
+ Resource : " *"
1420
1434
Version : 2012-10-17
1421
1435
PolicyName : root
1422
1436
Type : ' AWS::IAM::Role'
@@ -2108,6 +2122,66 @@ Resources:
2108
2122
- BucketArn : !GetAtt AuditTrailBucket.Arn
2109
2123
{{- end }}
2110
2124
2125
+ SessionManagerLogGroup :
2126
+ Type : AWS::Logs::LogGroup
2127
+ Properties :
2128
+ LogGroupName : " SessionManagerLogGroup-{{accountID .Cluster.InfrastructureAccount}}"
2129
+ RetentionInDays : 30
2130
+
2131
+ SessionManagerPreferencesDocument :
2132
+ Type : AWS::SSM::Document
2133
+ Properties :
2134
+ UpdateMethod : NewVersion
2135
+ Name : SSM-SessionManagerRunShell
2136
+ DocumentFormat : YAML
2137
+ DocumentType : Session
2138
+ Content :
2139
+ schemaVersion : ' 1.0'
2140
+ description : Document to hold regional settings for Session Manager
2141
+ sessionType : Standard_Stream
2142
+ inputs :
2143
+ cloudWatchLogGroupName : !Ref SessionManagerLogGroup
2144
+ cloudWatchEncryptionEnabled : false
2145
+ cloudWatchStreamingEnabled : true
2146
+ runAsEnabled : false
2147
+ idleSessionTimeout : ' 20'
2148
+ shellProfile :
2149
+ linux : ' bash'
2150
+
2151
+ SessionManagerSubscriptionFilter :
2152
+ Type : AWS::Logs::SubscriptionFilter
2153
+ Properties :
2154
+ LogGroupName : !Ref SessionManagerLogGroup
2155
+ RoleArn : !GetAtt SessionManagerSubscriptionFilterRole.Arn
2156
+ FilterName : " SessionManagerSubscriptionFilter-{{accountID .Cluster.InfrastructureAccount}}"
2157
+ FilterPattern : " "
2158
+ DestinationArn : " {{.Cluster.ConfigItems.session_manager_destination_arn}}"
2159
+
2160
+ SessionManagerSubscriptionFilterRole :
2161
+ Type : AWS::IAM::Role
2162
+ Properties :
2163
+ AssumeRolePolicyDocument :
2164
+ Version : " 2012-10-17"
2165
+ Statement :
2166
+ - Effect : Allow
2167
+ Principal :
2168
+ Service :
2169
+ - logs.amazonaws.com
2170
+ Action :
2171
+ - " sts:AssumeRole"
2172
+ Path : /
2173
+ Policies :
2174
+ - PolicyName : root
2175
+ PolicyDocument :
2176
+ Version : " 2012-10-17"
2177
+ Statement :
2178
+ - Effect : Allow
2179
+ Action :
2180
+ - " logs:PutLogEvents"
2181
+ Resource :
2182
+ - !GetAtt SessionManagerLogGroup.Arn
2183
+ RoleName : " SessionManagerSubscriptionFilterRole"
2184
+
2111
2185
AWSNodeDecommissionerIAMRole :
2112
2186
Type : ' AWS::IAM::Role'
2113
2187
Properties :
0 commit comments