Skip to content

Commit

Permalink
Updates syntax and additional fixes identified by tflint
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Aug 10, 2020
1 parent 5a725a4 commit 5d7f6b4
Show file tree
Hide file tree
Showing 52 changed files with 251 additions and 219 deletions.
6 changes: 3 additions & 3 deletions website/docs/d/acm_certificate.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ it by domain without having to hard code the ARNs as input.

```hcl
# Find a certificate that is issued
data "aws_acm_certificate" "example" {
data "aws_acm_certificate" "issued" {
domain = "tf.example.com"
statuses = ["ISSUED"]
}
# Find a certificate issued by (not imported into) ACM
data "aws_acm_certificate" "example" {
data "aws_acm_certificate" "amazon_issued" {
domain = "tf.example.com"
types = ["AMAZON_ISSUED"]
most_recent = true
}
# Find a RSA 4096 bit certificate
data "aws_acm_certificate" "example" {
data "aws_acm_certificate" "rsa_4096" {
domain = "tf.example.com"
key_types = ["RSA_4096"]
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/cloudformation_export.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ data "aws_cloudformation_export" "subnet_id" {
resource "aws_instance" "web" {
ami = "ami-abb07bcb"
instance_type = "t1.micro"
instance_type = "t2.micro"
subnet_id = data.aws_cloudformation_export.subnet_id.value
}
```
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/cloudformation_stack.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ data "aws_cloudformation_stack" "network" {
resource "aws_instance" "web" {
ami = "ami-abb07bcb"
instance_type = "t1.micro"
instance_type = "t2.micro"
subnet_id = data.aws_cloudformation_stack.network.outputs["SubnetId"]
tags = {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/d/ec2_instance_type_offering.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Information about single EC2 Instance Type Offering.
data "aws_ec2_instance_type_offering" "example" {
filter {
name = "instance-type"
values = ["t1.micro", "t2.micro", "t3.micro"]
values = ["t2.micro", "t3.micro"]
}
preferred_instance_types = ["t3.micro", "t2.micro", "t1.micro"]
preferred_instance_types = ["t3.micro", "t2.micro"]
}
```

Expand Down
8 changes: 4 additions & 4 deletions website/docs/d/kms_key.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ without having to hard code the ARN as input.
## Example Usage

```hcl
data "aws_kms_key" "foo" {
data "aws_kms_key" "by_alias" {
key_id = "alias/my-key"
}
data "aws_kms_key" "foo" {
data "aws_kms_key" "by_id" {
key_id = "1234abcd-12ab-34cd-56ef-1234567890ab"
}
data "aws_kms_key" "foo" {
data "aws_kms_key" "by_alias_arn" {
key_id = "arn:aws:kms:us-east-1:111122223333:alias/my-key"
}
data "aws_kms_key" "foo" {
data "aws_kms_key" "by_key_arn" {
key_id = "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
}
```
Expand Down
4 changes: 2 additions & 2 deletions website/docs/d/workspaces_bundle.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Retrieve information about an AWS WorkSpaces bundle.
## Example Usage

```hcl
data "aws_workspaces_bundle" "example" {
data "aws_workspaces_bundle" "by_id" {
bundle_id = "wsb-b0s22j3d7"
}
data "aws_workspaces_bundle" "example" {
data "aws_workspaces_bundle" "by_owner_and_name" {
owner = "AMAZON"
name = "Value with Windows 10 and Office 2016"
}
Expand Down
18 changes: 9 additions & 9 deletions website/docs/r/appsync_function.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Provides an AppSync Function.
## Example Usage

```hcl
resource "aws_appsync_graphql_api" "test" {
resource "aws_appsync_graphql_api" "example" {
authentication_type = "API_KEY"
name = "tf-example"
name = "example"
schema = <<EOF
type Mutation {
putPost(id: ID!, title: String!): Post
Expand All @@ -37,20 +37,20 @@ schema {
EOF
}
resource "aws_appsync_datasource" "test" {
api_id = aws_appsync_graphql_api.test.id
name = "tf-example"
resource "aws_appsync_datasource" "example" {
api_id = aws_appsync_graphql_api.example.id
name = "example"
type = "HTTP"
http_config {
endpoint = "http://example.com"
}
}
resource "aws_appsync_function" "test" {
api_id = aws_appsync_graphql_api.test.id
data_source = aws_appsync_datasource.test.name
name = "tf_example"
resource "aws_appsync_function" "example" {
api_id = aws_appsync_graphql_api.example.id
data_source = aws_appsync_datasource.example.name
name = "example"
request_mapping_template = <<EOF
{
"version": "2018-05-29",
Expand Down
56 changes: 32 additions & 24 deletions website/docs/r/autoscaling_policy.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,20 @@ The following arguments are only available to "StepScaling" type policies:
group scaling. These have the following structure:

```hcl
step_adjustment {
scaling_adjustment = -1
metric_interval_lower_bound = 1.0
metric_interval_upper_bound = 2.0
}
resource "aws_autoscaling_policy" "example" {
# ... other configuration ...
step_adjustment {
scaling_adjustment = -1
metric_interval_lower_bound = 1.0
metric_interval_upper_bound = 2.0
}
step_adjustment {
scaling_adjustment = 1
metric_interval_lower_bound = 2.0
metric_interval_upper_bound = 3.0
step_adjustment {
scaling_adjustment = 1
metric_interval_lower_bound = 2.0
metric_interval_upper_bound = 3.0
}
}
```

Expand All @@ -92,27 +96,31 @@ The following arguments are only available to "TargetTrackingScaling" type polic
* `target_tracking_configuration` - (Optional) A target tracking policy. These have the following structure:

```hcl
target_tracking_configuration {
predefined_metric_specification {
predefined_metric_type = "ASGAverageCPUUtilization"
resource "aws_autoscaling_policy" "example" {
# ... other configuration ...
target_tracking_configuration {
predefined_metric_specification {
predefined_metric_type = "ASGAverageCPUUtilization"
}
target_value = 40.0
}
target_value = 40.0
}
target_tracking_configuration {
customized_metric_specification {
metric_dimension {
name = "fuga"
value = "fuga"
}
target_tracking_configuration {
customized_metric_specification {
metric_dimension {
name = "fuga"
value = "fuga"
metric_name = "hoge"
namespace = "hoge"
statistic = "Average"
}
metric_name = "hoge"
namespace = "hoge"
statistic = "Average"
target_value = 40.0
}
target_value = 40.0
}
```

Expand Down
10 changes: 8 additions & 2 deletions website/docs/r/cloudfront_origin_access_identity.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ The below snippet demonstrates use with the `s3_origin_config` structure for the
[`aws_cloudfront_distribution`][3] resource:

```hcl
s3_origin_config {
origin_access_identity = aws_cloudfront_origin_access_identity.origin_access_identity.cloudfront_access_identity_path
resource "aws_cloudfront_distribution" "example" {
# ... other configuration ...
origin {
s3_origin_config {
origin_access_identity = aws_cloudfront_origin_access_identity.example.cloudfront_access_identity_path
}
}
}
```

Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/cognito_identity_pool.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Provides an AWS Cognito Identity Pool.
```hcl
resource "aws_iam_saml_provider" "default" {
name = "my-saml-provider"
saml_metadata_document = "${file("saml-metadata.xml")}"
saml_metadata_document = file("saml-metadata.xml")
}
resource "aws_cognito_identity_pool" "main" {
Expand All @@ -39,8 +39,8 @@ resource "aws_cognito_identity_pool" "main" {
"accounts.google.com" = "123456789012.apps.googleusercontent.com"
}
saml_provider_arns = ["${aws_iam_saml_provider.default.arn}"]
openid_connect_provider_arns = ["arn:aws:iam::123456789012:oidc-provider/foo.example.com"]
saml_provider_arns = [aws_iam_saml_provider.default.arn]
openid_connect_provider_arns = ["arn:aws:iam::123456789012:oidc-provider/id.example.com"]
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ EOF
resource "aws_iam_role_policy" "authenticated" {
name = "authenticated_policy"
role = "${aws_iam_role.authenticated.id}"
role = aws_iam_role.authenticated.id
policy = <<EOF
{
Expand All @@ -74,7 +74,7 @@ EOF
}
resource "aws_cognito_identity_pool_roles_attachment" "main" {
identity_pool_id = "${aws_cognito_identity_pool.main.id}"
identity_pool_id = aws_cognito_identity_pool.main.id
role_mapping {
identity_provider = "graph.facebook.com"
Expand All @@ -84,13 +84,13 @@ resource "aws_cognito_identity_pool_roles_attachment" "main" {
mapping_rule {
claim = "isAdmin"
match_type = "Equals"
role_arn = "${aws_iam_role.authenticated.arn}"
role_arn = aws_iam_role.authenticated.arn
value = "paid"
}
}
roles = {
"authenticated" = "${aws_iam_role.authenticated.arn}"
"authenticated" = aws_iam_role.authenticated.arn
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/cognito_resource_server.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resource "aws_cognito_resource_server" "resource" {
identifier = "https://example.com"
name = "example"
user_pool_id = "${aws_cognito_user_pool.pool.id}"
user_pool_id = aws_cognito_user_pool.pool.id
}
```

Expand All @@ -44,7 +44,7 @@ resource "aws_cognito_resource_server" "resource" {
scope_description = "a Sample Scope Description"
}
user_pool_id = "${aws_cognito_user_pool.pool.id}"
user_pool_id = aws_cognito_user_pool.pool.id
}
```

Expand Down
10 changes: 5 additions & 5 deletions website/docs/r/cognito_user_pool.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ resource "aws_cognito_user_pool" "example" {
name = "<name>"
attribute_data_type = "<appropriate type>"
developer_only_attribute = false
mutable = true // false for "sub"
required = false // true for "sub"
string_attribute_constraints { // if it is a string
min_length = 0 // 10 for "birthdate"
max_length = 2048 // 10 for "birthdate"
mutable = true # false for "sub"
required = false # true for "sub"
string_attribute_constraints { # if it is a string
min_length = 0 # 10 for "birthdate"
max_length = 2048 # 10 for "birthdate"
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions website/docs/r/cognito_user_pool_client.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_cognito_user_pool" "pool" {
resource "aws_cognito_user_pool_client" "client" {
name = "client"
user_pool_id = "${aws_cognito_user_pool.pool.id}"
user_pool_id = aws_cognito_user_pool.pool.id
}
```

Expand All @@ -36,7 +36,7 @@ resource "aws_cognito_user_pool" "pool" {
resource "aws_cognito_user_pool_client" "client" {
name = "client"
user_pool_id = "${aws_cognito_user_pool.pool.id}"
user_pool_id = aws_cognito_user_pool.pool.id
generate_secret = true
explicit_auth_flows = ["ADMIN_NO_SRP_AUTH"]
Expand Down Expand Up @@ -78,33 +78,33 @@ EOF
resource "aws_iam_role_policy" "test" {
name = "role_policy"
role = "${aws_iam_role.test.id}"
role = aws_iam_role.test.id
policy = <<-EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"mobiletargeting:UpdateEndpoint",
"mobiletargeting:PutItems"
],
"Effect": "Allow",
"Resource": "arn:aws:mobiletargeting:*:${data.aws_caller_identity.current.account_id}:apps/${aws_pinpoint_app.test.application_id}*"
}
]
}
EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"mobiletargeting:UpdateEndpoint",
"mobiletargeting:PutItems"
],
"Effect": "Allow",
"Resource": "arn:aws:mobiletargeting:*:${data.aws_caller_identity.current.account_id}:apps/${aws_pinpoint_app.test.application_id}*"
}
]
}
EOF
}
resource "aws_cognito_user_pool_client" "test" {
name = "pool_client"
user_pool_id = "${aws_cognito_user_pool.test.id}"
user_pool_id = aws_cognito_user_pool.test.id
analytics_configuration {
application_id = "${aws_pinpoint_app.test.application_id}"
application_id = aws_pinpoint_app.test.application_id
external_id = "some_id"
role_arn = "${aws_iam_role.test.arn}"
role_arn = aws_iam_role.test.arn
user_data_shared = true
}
}
Expand Down
Loading

0 comments on commit 5d7f6b4

Please sign in to comment.