1- resource " aws_iam_role" " glue_service_role" {
1+ resource "aws_iam_role" "glue_service_role" {
22 name = " glue_service_role"
33
44 assume_role_policy = jsonencode ({
5- " Version" : " 2012-10-17" ,
6- " Statement" : [
7- {
8- " Effect" : " Allow" ,
9- " Principal" : {
10- " Service" : " glue.amazonaws.com"
5+ " Version" : " 2012-10-17" ,
6+ " Statement" : [
7+ {
8+ " Effect" : " Allow" ,
9+ " Principal" : {
10+ " Service" : " glue.amazonaws.com"
1111 },
12- " Action" : " sts:AssumeRole"
13- }
12+ " Action" : " sts:AssumeRole"
13+ }
1414 ]
15- })
15+ })
1616}
1717
18- resource " aws_iam_role_policy" " glue_service_role_policy" {
19- name = " glue_service_role_policy"
20- role = aws_iam_role.glue_service_role.name
18+ resource "aws_iam_role_policy" "glue_service_role_policy" {
19+ name = " glue_service_role_policy"
20+ role = aws_iam_role. glue_service_role . name
2121 policy = jsonencode ({
22- " Version" : " 2012-10-17" ,
23- " Statement" : [
24- {
25- " Effect" : " Allow" ,
26- " Action" : [
27- " glue:*" ,
28- " s3:GetBucketLocation" ,
29- " s3:ListBucket" ,
30- " s3:ListAllMyBuckets" ,
31- " s3:GetBucketAcl" ,
32- " ec2:DescribeVpcEndpoints" ,
33- " ec2:DescribeRouteTables" ,
34- " ec2:CreateNetworkInterface" ,
35- " ec2:DeleteNetworkInterface" ,
36- " ec2:DescribeNetworkInterfaces" ,
37- " ec2:DescribeSecurityGroups" ,
38- " ec2:DescribeSubnets" ,
39- " ec2:DescribeVpcAttribute" ,
40- " iam:ListRolePolicies" ,
41- " iam:GetRole" ,
42- " iam:GetRolePolicy" ,
43- " cloudwatch:PutMetricData"
22+ " Version" : " 2012-10-17" ,
23+ " Statement" : [
24+ {
25+ " Effect" : " Allow" ,
26+ " Action" : [
27+ " glue:*" ,
28+ " s3:GetBucketLocation" ,
29+ " s3:ListBucket" ,
30+ " s3:ListAllMyBuckets" ,
31+ " s3:GetBucketAcl" ,
32+ " ec2:DescribeVpcEndpoints" ,
33+ " ec2:DescribeRouteTables" ,
34+ " ec2:CreateNetworkInterface" ,
35+ " ec2:DeleteNetworkInterface" ,
36+ " ec2:DescribeNetworkInterfaces" ,
37+ " ec2:DescribeSecurityGroups" ,
38+ " ec2:DescribeSubnets" ,
39+ " ec2:DescribeVpcAttribute" ,
40+ " iam:ListRolePolicies" ,
41+ " iam:GetRole" ,
42+ " iam:GetRolePolicy" ,
43+ " cloudwatch:PutMetricData"
4444 ],
45- " Resource" : [" *" ]
46- },
47- {
48- " Effect" : " Allow" ,
49- " Action" : [" s3:CreateBucket" ],
50- " Resource" : [" arn:aws:s3:::aws-glue-*" ]
51- },
52- {
53- " Effect" : " Allow" ,
54- " Action" : [" s3:GetObject" , " s3:PutObject" , " s3:DeleteObject" ],
55- " Resource" : [
56- " arn:aws:s3:::*/*" ,
57- " arn:aws:s3:::*/*aws-glue-*/*"
45+ " Resource" : [" *" ]
46+ },
47+ {
48+ " Effect" : " Allow" ,
49+ " Action" : [" s3:CreateBucket" ],
50+ " Resource" : [" arn:aws:s3:::aws-glue-*" ]
51+ },
52+ {
53+ " Effect" : " Allow" ,
54+ " Action" : [" s3:GetObject" , " s3:PutObject" , " s3:DeleteObject" ],
55+ " Resource" : [
56+ " arn:aws:s3:::*/*" ,
57+ " arn:aws:s3:::*/*aws-glue-*/*"
5858 ]
59- },
60- {
61- " Effect" : " Allow" ,
62- " Action" : [" s3:GetObject" ],
63- " Resource" : [
64- " arn:aws:s3:::crawler-public*" ,
65- " arn:aws:s3:::aws-glue-*"
59+ },
60+ {
61+ " Effect" : " Allow" ,
62+ " Action" : [" s3:GetObject" ],
63+ " Resource" : [
64+ " arn:aws:s3:::crawler-public*" ,
65+ " arn:aws:s3:::aws-glue-*"
6666 ]
67- },
68- {
69- " Effect" : " Allow" ,
70- " Action" : [
71- " logs:CreateLogGroup" ,
72- " logs:CreateLogStream" ,
73- " logs:PutLogEvents"
67+ },
68+ {
69+ " Effect" : " Allow" ,
70+ " Action" : [
71+ " logs:CreateLogGroup" ,
72+ " logs:CreateLogStream" ,
73+ " logs:PutLogEvents"
7474 ],
75- " Resource" : [" arn:aws:logs:*:*:*:/aws-glue/*" ]
76- },
77- {
78- " Effect" : " Allow" ,
79- " Action" : [" ec2:CreateTags" , " ec2:DeleteTags" ],
80- " Condition" : {
81- " ForAllValues:StringEquals" : {
82- " aws:TagKeys" : [" aws-glue-service-resource" ]
83- }
75+ " Resource" : [" arn:aws:logs:*:*:*:/aws-glue/*" ]
76+ },
77+ {
78+ " Effect" : " Allow" ,
79+ " Action" : [" ec2:CreateTags" , " ec2:DeleteTags" ],
80+ " Condition" : {
81+ " ForAllValues:StringEquals" : {
82+ " aws:TagKeys" : [" aws-glue-service-resource" ]
83+ }
8484 },
85- " Resource" : [
86- " arn:aws:ec2:*:*:network-interface/*" ,
87- " arn:aws:ec2:*:*:security-group/*" ,
88- " arn:aws:ec2:*:*:instance/*"
85+ " Resource" : [
86+ " arn:aws:ec2:*:*:network-interface/*" ,
87+ " arn:aws:ec2:*:*:security-group/*" ,
88+ " arn:aws:ec2:*:*:instance/*"
8989 ]
90- }
90+ }
9191 ]
92- })
93- }
92+ })
93+ }
0 commit comments