launchinstances.json.j2 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. "Version": "2012-10-17",
  3. "Statement": [
  4. {
  5. "Sid": "AllowPassDescribeInstancesRole",
  6. "Effect": "Allow",
  7. "Action": [
  8. "iam:PassRole"
  9. ],
  10. "Resource": [
  11. "arn:aws:iam::*:role/openshift_node_describe_instances_{{ openshift_aws_clusterid }}"
  12. ]
  13. },
  14. {
  15. "Sid": "AllowDescribeResources",
  16. "Effect": "Allow",
  17. "Action": [
  18. "ec2:DescribeAvailabilityZones",
  19. "ec2:DescribeImages",
  20. "ec2:DescribeInstances",
  21. "ec2:DescribeKeyPairs",
  22. "ec2:DescribeSecurityGroups",
  23. "ec2:DescribeVpcs",
  24. "ec2:DescribeSubnets"
  25. ],
  26. "Resource": [
  27. "*"
  28. ]
  29. },
  30. {
  31. "Sid": "AllowRunInstances",
  32. "Effect": "Allow",
  33. "Action": [
  34. "ec2:RunInstances"
  35. ],
  36. "Resource": [
  37. "arn:aws:ec2:*:*:image/*",
  38. "arn:aws:ec2:*:*:subnet/*",
  39. "arn:aws:ec2:*:*:network-interface/*",
  40. "arn:aws:ec2:*:*:security-group/*",
  41. "arn:aws:ec2:*:*:key-pair/*"
  42. ]
  43. },
  44. {
  45. "Sid": "AllowRunTaggedInstances",
  46. "Effect": "Allow",
  47. "Action": [
  48. "ec2:RunInstances"
  49. ],
  50. "Resource": [
  51. "arn:aws:ec2:*:*:volume/*",
  52. "arn:aws:ec2:*:*:instance/*"
  53. ],
  54. "Condition": {
  55. "StringEquals": {
  56. "aws:RequestTag/clusterid": "{{ openshift_aws_clusterid }}"
  57. },
  58. "ForAnyValue:StringEquals": {
  59. "aws:TagKeys": [
  60. "clusterid"
  61. ]
  62. }
  63. }
  64. },
  65. {
  66. "Sid": "AllowCreateTagsRunInstances",
  67. "Effect": "Allow",
  68. "Action": [
  69. "ec2:CreateTags"
  70. ],
  71. "Resource": "arn:aws:ec2:*:*:*/*",
  72. "Condition": {
  73. "StringEquals": {
  74. "ec2:CreateAction": "RunInstances"
  75. }
  76. }
  77. },
  78. {
  79. "Sid": "AllowCreateTaggedVolumes",
  80. "Effect": "Allow",
  81. "Action": [
  82. "ec2:CreateVolume"
  83. ],
  84. "Resource": [
  85. "arn:aws:ec2:*:*:volume/*"
  86. ],
  87. "Condition": {
  88. "StringEquals": {
  89. "aws:RequestTag/clusterid": "{{ openshift_aws_clusterid }}"
  90. },
  91. "ForAnyValue:StringEquals": {
  92. "aws:TagKeys": [
  93. "clusterid"
  94. ]
  95. }
  96. }
  97. },
  98. {
  99. "Sid": "AllowCreateTagsCreateVolume",
  100. "Effect": "Allow",
  101. "Action": [
  102. "ec2:CreateTags"
  103. ],
  104. "Resource": "arn:aws:ec2:*:*:*/*",
  105. "Condition": {
  106. "StringEquals": {
  107. "ec2:CreateAction": "CreateVolume"
  108. }
  109. }
  110. },
  111. {
  112. "Sid": "AllowManageTaggedInstances",
  113. "Effect": "Allow",
  114. "Action": [
  115. "ec2:StartInstances",
  116. "ec2:StopInstances",
  117. "ec2:TerminateInstances"
  118. ],
  119. "Resource": [
  120. "*"
  121. ],
  122. "Condition": {
  123. "StringEquals": {
  124. "ec2:ResourceTag/clusterid": "{{ openshift_aws_clusterid }}"
  125. }
  126. }
  127. },
  128. {
  129. "Sid": "AllowManageTaggedVolumes",
  130. "Effect": "Allow",
  131. "Action": [
  132. "ec2:DetachVolume",
  133. "ec2:DeleteVolume",
  134. "ec2:AttachVolume"
  135. ],
  136. "Resource": [
  137. "*"
  138. ],
  139. "Condition": {
  140. "StringEquals": {
  141. "ec2:ResourceTag/clusterid": "{{ openshift_aws_clusterid }}"
  142. }
  143. }
  144. }
  145. ]
  146. }