Merge pull request #11858 from hashicorp/f-fix-acc-tests
provider/aws: Fix ECS Task Definition Acceptance tests
This commit is contained in:
commit
f3befb0fe5
|
@ -347,7 +347,7 @@ func testAccAWSEcsTaskDefinitionWithTaskRoleArn(rInt int) string {
|
||||||
name = "tf_old_name-%d"
|
name = "tf_old_name-%d"
|
||||||
path = "/test/"
|
path = "/test/"
|
||||||
assume_role_policy = <<EOF
|
assume_role_policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
{
|
{
|
||||||
|
@ -359,15 +359,15 @@ func testAccAWSEcsTaskDefinitionWithTaskRoleArn(rInt int) string {
|
||||||
"Sid": ""
|
"Sid": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_role_policy" "role_test" {
|
resource "aws_iam_role_policy" "role_test" {
|
||||||
name = "role_update_test-%d"
|
name = "role_update_test-%d"
|
||||||
role = "${aws_iam_role.role_test.id}"
|
role = "${aws_iam_role.role_test.id}"
|
||||||
policy = <<EOF
|
policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
{
|
{
|
||||||
|
@ -379,15 +379,15 @@ func testAccAWSEcsTaskDefinitionWithTaskRoleArn(rInt int) string {
|
||||||
"Resource": "arn:aws:s3:::*"
|
"Resource": "arn:aws:s3:::*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_ecs_task_definition" "sleep" {
|
resource "aws_ecs_task_definition" "sleep" {
|
||||||
family = "terraform-acc-sc-volume-test"
|
family = "terraform-acc-sc-volume-test"
|
||||||
task_role_arn = "${aws_iam_role.role_test.arn}"
|
task_role_arn = "${aws_iam_role.role_test.arn}"
|
||||||
container_definitions = <<TASK_DEFINITION
|
container_definitions = <<TASK_DEFINITION
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "sleep",
|
"name": "sleep",
|
||||||
"image": "busybox",
|
"image": "busybox",
|
||||||
|
@ -396,13 +396,12 @@ func testAccAWSEcsTaskDefinitionWithTaskRoleArn(rInt int) string {
|
||||||
"memory": 10,
|
"memory": 10,
|
||||||
"essential": true
|
"essential": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
TASK_DEFINITION
|
TASK_DEFINITION
|
||||||
|
|
||||||
volume {
|
volume {
|
||||||
name = "database_scratch"
|
name = "database_scratch"
|
||||||
}
|
}
|
||||||
}`, rInt, rInt)
|
}`, rInt, rInt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
|
@ -411,7 +410,7 @@ func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
name = "tf_old_name-%d"
|
name = "tf_old_name-%d"
|
||||||
path = "/test/"
|
path = "/test/"
|
||||||
assume_role_policy = <<EOF
|
assume_role_policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
{
|
{
|
||||||
|
@ -423,15 +422,15 @@ func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
"Sid": ""
|
"Sid": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_iam_role_policy" "role_test" {
|
resource "aws_iam_role_policy" "role_test" {
|
||||||
name = "role_update_test-%d"
|
name = "role_update_test-%d"
|
||||||
role = "${aws_iam_role.role_test.id}"
|
role = "${aws_iam_role.role_test.id}"
|
||||||
policy = <<EOF
|
policy = <<EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [
|
"Statement": [
|
||||||
{
|
{
|
||||||
|
@ -443,7 +442,7 @@ func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
"Resource": "arn:aws:s3:::*"
|
"Resource": "arn:aws:s3:::*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,7 +451,7 @@ func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
task_role_arn = "${aws_iam_role.role_test.arn}"
|
task_role_arn = "${aws_iam_role.role_test.arn}"
|
||||||
network_mode = "bridge"
|
network_mode = "bridge"
|
||||||
container_definitions = <<TASK_DEFINITION
|
container_definitions = <<TASK_DEFINITION
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "sleep",
|
"name": "sleep",
|
||||||
"image": "busybox",
|
"image": "busybox",
|
||||||
|
@ -461,8 +460,8 @@ func testAccAWSEcsTaskDefinitionWithNetworkMode(rInt int) string {
|
||||||
"memory": 10,
|
"memory": 10,
|
||||||
"essential": true
|
"essential": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
TASK_DEFINITION
|
TASK_DEFINITION
|
||||||
|
|
||||||
volume {
|
volume {
|
||||||
name = "database_scratch"
|
name = "database_scratch"
|
||||||
|
|
Loading…
Reference in New Issue