mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-10 23:55:34 -06:00
32 lines
748 B
Go
32 lines
748 B
Go
package aws
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAWSIAMInstanceProfile_basic(t *testing.T) {
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccAwsIamInstanceProfileConfig,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
const testAccAwsIamInstanceProfileConfig = `
|
|
resource "aws_iam_role" "test" {
|
|
name = "test"
|
|
assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"ec2.amazonaws.com\"]},\"Action\":[\"sts:AssumeRole\"]}]}"
|
|
}
|
|
|
|
resource "aws_iam_instance_profile" "test" {
|
|
name = "test"
|
|
roles = ["${aws_iam_role.test.name}"]
|
|
}
|
|
`
|