Skip to content

Commit

Permalink
Add time sleep for aws_s3_bucket_public_access_block resource
Browse files Browse the repository at this point in the history
  • Loading branch information
lgallard committed Aug 24, 2021
1 parent e2144f4 commit 2d0bd74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,7 @@ We have a tfstate S3 Bucket per account
|------|---------|
| <a name="provider_aws.main_region"></a> [aws.main\_region](#provider\_aws.main\_region) | ~> 3.0 |
| <a name="provider_aws.secondary_region"></a> [aws.secondary\_region](#provider\_aws.secondary\_region) | ~> 3.0 |
| <a name="provider_time"></a> [time](#provider\_time) | n/a |

## Modules

Expand All @@ -64,6 +65,7 @@ No modules.
| [aws_s3_bucket_policy.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_policy.default-ssl-vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [time_sleep.wait_2_mins](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [aws_iam_policy_document.default-ssl](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.default-ssl-vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |

Expand Down
12 changes: 7 additions & 5 deletions main.tf
Expand Up @@ -51,12 +51,14 @@ resource "aws_s3_bucket_public_access_block" "default" {
ignore_public_acls = var.ignore_public_acls
block_public_policy = var.block_public_policy
restrict_public_buckets = var.restrict_public_buckets
depends_on = [aws_s3_bucket.default]
depends_on = [aws_s3_bucket.default, time_sleep.wait_2_mins]

timeouts {
create = "1h"
delete = "2h"
}
}

resource "time_sleep" "wait_2_mins" {
depends_on = [null_resource.previous]

create_duration = "2m"
}

resource "aws_dynamodb_table" "with_server_side_encryption" {
Expand Down

0 comments on commit 2d0bd74

Please sign in to comment.