Update terraform to use instance profile
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 52s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 52s
This commit is contained in:
@ -177,6 +177,7 @@ resource "aws_instance" "my_second_linux" {
|
|||||||
instance_type = "t2.micro"
|
instance_type = "t2.micro"
|
||||||
ami = aws_ami_from_instance.ami_snapshot.arn
|
ami = aws_ami_from_instance.ami_snapshot.arn
|
||||||
security_groups = ["ssh-access-witch"]
|
security_groups = ["ssh-access-witch"]
|
||||||
|
iam_instance_profile = aws_iam_instance_profile.daphodell_profile.name
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
Name = "labs"
|
Name = "labs"
|
||||||
|
|||||||
@ -3,6 +3,7 @@ resource "aws_instance" "my_first_linux" {
|
|||||||
ami = "ami-06971c49acd687c30"
|
ami = "ami-06971c49acd687c30"
|
||||||
|
|
||||||
security_groups = ["ssh-access-witch"]
|
security_groups = ["ssh-access-witch"]
|
||||||
|
iam_instance_profile = aws_iam_instance_profile.daphodell_profile.name
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
Name = "labs"
|
Name = "labs"
|
||||||
@ -61,6 +62,11 @@ resource "aws_iam_role" "daphodell_role" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_iam_instance_profile" "daphodell_profile" {
|
||||||
|
name = "daphodell_profile"
|
||||||
|
role = aws_iam_role.daphodell_role.name
|
||||||
|
}
|
||||||
|
|
||||||
## Policies
|
## Policies
|
||||||
## Allow user CLI -> S3 read/write
|
## Allow user CLI -> S3 read/write
|
||||||
resource "aws_iam_policy" "assume_role_s3_policy" {
|
resource "aws_iam_policy" "assume_role_s3_policy" {
|
||||||
Reference in New Issue
Block a user