mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-15 01:53:51 -06:00
32 lines
742 B
Go
32 lines
742 B
Go
|
package aws
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/hashicorp/terraform/helper/resource"
|
||
|
)
|
||
|
|
||
|
func TestAccAwsIamInstanceProfile(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}"]
|
||
|
}
|
||
|
`
|