Skip to content

Commit 198c48d

Browse files
committed
Rename role and output ARN
1 parent 9c54d63 commit 198c48d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

static-site/data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ data "aws_iam_policy_document" "static_site" {
4242
}
4343
}
4444

45-
data "aws_iam_policy_document" "deploy_web" {
45+
data "aws_iam_policy_document" "deploy_static_site" {
4646
statement {
4747
actions = [
4848
"s3:ListBucket",

static-site/iam.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
# your site via pipelines.
44
###############################################
55

6-
resource "aws_iam_role" "deploy_web" {
6+
resource "aws_iam_role" "deploy_static_site" {
77
name = var.role_name
88
assume_role_policy = data.aws_iam_policy_document.oidc.json
99
tags = var.tags
1010
provider = aws.default
1111
}
1212

13-
resource "aws_iam_policy" "deploy_web" {
13+
resource "aws_iam_policy" "deploy_static_site" {
1414
name = var.role_name
15-
policy = data.aws_iam_policy_document.deploy_web.json
15+
policy = data.aws_iam_policy_document.deploy_static_site.json
1616
tags = var.tags
1717
provider = aws.default
1818
}
1919

20-
resource "aws_iam_role_policy_attachment" "deploy_web" {
21-
role = aws_iam_role.deploy_web.name
22-
policy_arn = aws_iam_policy.deploy_web.arn
20+
resource "aws_iam_role_policy_attachment" "deploy_static_site" {
21+
role = aws_iam_role.deploy_static_site.name
22+
policy_arn = aws_iam_policy.deploy_static_site.arn
2323
provider = aws.default
2424
}

static-site/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ output "bucket_name" {
22
value = aws_s3_bucket.static_site.bucket
33
}
44

5+
output "deploy_role_arn" {
6+
value = aws_iam_role.deploy_static_site.arn
7+
}
8+
59
output "cloudfront_dist_id" {
610
value = aws_cloudfront_distribution.static_site.id
711
}

0 commit comments

Comments
 (0)