mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-09 23:54:17 -06:00
ecb4b5aada
* add opsworks permission resource * add docs * remove permission from state if the permission object could not be found * remove nil validate function. validation is done in schema.Resource. * add id to the list of exported values * renge over permission to check that we have found got the correct one * removed comment * removed set id * fix unknown region us-east-1c * add user_profile resource * add docs * add default value
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package aws
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAWSOpsworksPermission(t *testing.T) {
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccAwsOpsworksPermissionCreate,
|
|
Check: resource.ComposeTestCheckFunc(
|
|
resource.TestCheckResourceAttr(
|
|
"aws_opsworks_permission.tf-acc-perm", "allow_ssh", "true",
|
|
),
|
|
resource.TestCheckResourceAttr(
|
|
"aws_opsworks_permission.tf-acc-perm", "allow_sudo", "true",
|
|
),
|
|
resource.TestCheckResourceAttr(
|
|
"aws_opsworks_permission.tf-acc-perm", "level", "iam_only",
|
|
),
|
|
),
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
var testAccAwsOpsworksPermissionCreate = testAccAwsOpsworksUserProfileCreate + `
|
|
resource "aws_opsworks_permission" "tf-acc-perm" {
|
|
stack_id = "${aws_opsworks_stack.tf-acc.id}"
|
|
|
|
allow_ssh = true
|
|
allow_sudo = true
|
|
user_arn = "${aws_opsworks_user_profile.user.user_arn}"
|
|
level = "iam_only"
|
|
}
|
|
`
|