-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasset.tf
More file actions
34 lines (30 loc) · 981 Bytes
/
asset.tf
File metadata and controls
34 lines (30 loc) · 981 Bytes
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
resource "aws_iam_role" "execution" {
provider = aws.asset
name = "AWSCloudFormationStackSetExecutionRole"
assume_role_policy = jsonencode(
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : ["sts:AssumeRole"],
"Principal" : {
"AWS" : aws_iam_role.admin.arn
}
}
]
}
)
}
# Specifies the set of permissions required for the deployment of the Cloudfomation stack
module "elastio_policies" {
# Use this module from the Cloudsmith registry via the URL in real code:
# source = "terraform.cloudsmith.io/public/elastio-iam-policies/aws"
source = "../../../../../iam-policies/terraform"
policies = ["ElastioAssetAccountDeployer"]
}
resource "aws_iam_role_policy_attachment" "execution_deployment" {
provider = aws.asset
policy_arn = module.elastio_policies.policies.ElastioAssetAccountDeployer.arn
role = aws_iam_role.execution.name
}