Skip to content

Commit

Permalink
Merge branch 'master' into td-tfproviderlint-V005
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad authored Apr 28, 2020
2 parents 7b2de2b + dcb0096 commit f12736e
Show file tree
Hide file tree
Showing 1,192 changed files with 110,545 additions and 124,387 deletions.
28 changes: 21 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ More details about this code generation, including fixes for potential error mes
}
```

- Otherwise if the API does not support tagging on creation (the `Input` struct does not accept a `Tags` field), in the resource `Create` function, implement the logic to convert the configuration tags into the service API call to tag a resource, e.g. with CloudHSM v2 Clusters:
- Otherwise if the API does not support tagging on creation (the `Input` struct does not accept a `Tags` field), in the resource `Create` function, implement the logic to convert the configuration tags into the service API call to tag a resource, e.g. with ElasticSearch Domain:

```go
if v := d.Get("tags").(map[string]interface{}); len(v) > 0 {
if err := keyvaluetags.Cloudhsmv2UpdateTags(conn, d.Id(), nil, v); err != nil {
return fmt.Errorf("error adding CloudHSM v2 Cluster (%s) tags: %s", d.Id(), err)
if err := keyvaluetags.ElasticsearchserviceUpdateTags(conn, d.Id(), nil, v); err != nil {
return fmt.Errorf("error adding Elasticsearch Cluster (%s) tags: %s", d.Id(), err)
}
}
```
Expand Down Expand Up @@ -691,12 +691,12 @@ While region validation is automatically added with SDK updates, new regions
are generally limited in which services they support. Below are some
manually sourced values from documentation.

- [ ] Check [Regions and Endpoints ELB regions](https://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) and add Route53 Hosted Zone ID if available to `aws/data_source_aws_elb_hosted_zone_id.go`
- [ ] Check [Regions and Endpoints S3 website endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_website_region_endpoints) and add Route53 Hosted Zone ID if available to `aws/hosted_zones.go`
- [ ] Check [Elastic Load Balancing endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/elb.html#elb_region) and add Route53 Hosted Zone ID if available to `aws/data_source_aws_elb_hosted_zone_id.go`
- [ ] Check [Amazon Simple Storage Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region) and add Route53 Hosted Zone ID if available to `aws/hosted_zones.go`
- [ ] Check [CloudTrail Supported Regions docs](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-supported-regions.html#cloudtrail-supported-regions) and add AWS Account ID if available to `aws/data_source_aws_cloudtrail_service_account.go`
- [ ] Check [Elastic Load Balancing Access Logs docs](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy) and add Elastic Load Balancing Account ID if available to `aws/data_source_aws_elb_service_account.go`
- [ ] Check [Redshift Database Audit Logging docs](https://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html#db-auditing-bucket-permissions) and add AWS Account ID if available to `aws/data_source_aws_redshift_service_account.go`
- [ ] Check [Regions and Endpoints Elastic Beanstalk](https://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region) and add Route53 Hosted Zone ID if available to `aws/data_source_aws_elastic_beanstalk_hosted_zone.go`
- [ ] Check [AWS Elastic Beanstalk endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/elasticbeanstalk.html#elasticbeanstalk_region) and add Route53 Hosted Zone ID if available to `aws/data_source_aws_elastic_beanstalk_hosted_zone.go`

### Common Review Items

Expand Down Expand Up @@ -824,7 +824,19 @@ The below are location-based items that _may_ be noted during review and are rec
}
```

- [ ] __Uses aws_availability_zones Data Source__: Any hardcoded AWS Availability Zone configuration, e.g. `us-west-2a`, should be replaced with the [`aws_availability_zones` data source](https://www.terraform.io/docs/providers/aws/d/availability_zones.html). A common pattern is declaring `data "aws_availability_zones" "current" {}` and referencing it via `data.aws_availability_zones.current.names[0]` or `data.aws_availability_zones.current.names[count.index]` in resources utilizing `count`.
- [ ] __Uses aws_availability_zones Data Source__: Any hardcoded AWS Availability Zone configuration, e.g. `us-west-2a`, should be replaced with the [`aws_availability_zones` data source](https://www.terraform.io/docs/providers/aws/d/availability_zones.html). A common pattern is declaring `data "aws_availability_zones" "available" {...}` and referencing it via `data.aws_availability_zones.available.names[0]` or `data.aws_availability_zones.available.names[count.index]` in resources utilizing `count`.

```hcl
data "aws_availability_zones" "available" {
state = "available"
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}
```

- [ ] __Uses aws_region Data Source__: Any hardcoded AWS Region configuration, e.g. `us-west-2`, should be replaced with the [`aws_region` data source](https://www.terraform.io/docs/providers/aws/d/region.html). A common pattern is declaring `data "aws_region" "current" {}` and referencing it via `data.aws_region.current.name`
- [ ] __Uses aws_partition Data Source__: Any hardcoded AWS Partition configuration, e.g. the `aws` in a `arn:aws:SERVICE:REGION:ACCOUNT:RESOURCE` ARN, should be replaced with the [`aws_partition` data source](https://www.terraform.io/docs/providers/aws/d/partition.html). A common pattern is declaring `data "aws_partition" "current" {}` and referencing it via `data.aws_partition.current.partition`
- [ ] __Uses Builtin ARN Check Functions__: Tests should utilize available ARN check functions, e.g. `testAccMatchResourceAttrRegionalARN()`, to validate ARN attribute values in the Terraform state over `resource.TestCheckResourceAttrSet()` and `resource.TestMatchResourceAttr()`
Expand Down Expand Up @@ -907,6 +919,8 @@ PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 55.619s
```

Please Note: On macOS 10.14 and later (and some Linux distributions), the default user open file limit is 256. This may cause unexpected issues when running the acceptance testing since this can prevent various operations from occurring such as opening network connections to AWS. To view this limit, the `ulimit -n` command can be run. To update this limit, run `ulimit -n 1024` (or higher).

#### Writing an Acceptance Test

Terraform has a framework for writing acceptance tests which minimises the
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/[email protected]
- name: Apply Issue Triage Label
uses: actions/[email protected]
if: github.event.action == 'opened'
if: github.event.action == 'opened' && !contains(fromJSON('["bflad", "breathingdust", "ewbankkit", "gdavison", "maryelizbeth"]'), github.actor)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Stale issues and pull requests"
on:
schedule:
- cron: "40 17 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 720
days-before-close: 30
exempt-issue-label: 'needs-triage'
exempt-pr-label: 'needs-triage'
operations-per-run: 100
stale-issue-label: 'stale'
stale-issue-message: |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
stale-pr-label: 'stale'
stale-pr-message: |
Marking this pull request as stale due to inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you!
24 changes: 5 additions & 19 deletions .hashibot.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
poll "closed_issue_locker" "locker" {
schedule = "0 50 14 * * *"
schedule = "0 10 17 * * *"
closed_for = "720h" # 30 days
max_issues = 500
sleep_between_issues = "5s"
Expand All @@ -11,21 +11,6 @@ poll "closed_issue_locker" "locker" {
EOF
}

poll "stale_issue_closer" "closer" {
schedule = "0 22 23 * * *"
no_reply_in_last = "2160h" # 90 days
max_issues = 500
sleep_between_issues = "5s"
created_after = "2019-06-01"
exclude_labels = ["needs-triage", "technical-debt"]
extra_search_params = "reactions:<20 no:milestone no:assignee"
message = <<-EOF
I'm going to close this issue due to inactivity (_90 days_ without response ⏳ ). This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
EOF
}

behavior "deprecated_import_commenter" "hashicorp_terraform" {
import_regexp = "github.com/hashicorp/terraform/"
marker_label = "terraform-plugin-sdk-migration"
Expand Down Expand Up @@ -440,7 +425,7 @@ behavior "regexp_issue_labeler_v2" "service_labels" {
"aws_route53_([^d]|d[^o]|do[^m]|dom[^a]|doma[^i]|domai[^n]|domain[^s]|domains[^_]|[^r]|r[^e]|re[^s]|res[^o]|reso[^l]|resol[^v]|resolv[^e]|resolve[^r]|resolver[^_])",
],
"service/route53domains" = [
"aws_route53_domains_",
"aws_route53domains_",
],
"service/route53resolver" = [
"aws_route53_resolver_",
Expand Down Expand Up @@ -535,6 +520,7 @@ behavior "pull_request_path_labeler" "service_labels" {
label_map = {
# label provider related changes
"provider" = [
".github/*.md",
"aws/auth_helpers.go",
"aws/awserr.go",
"aws/config.go",
Expand Down Expand Up @@ -1094,8 +1080,8 @@ behavior "pull_request_path_labeler" "service_labels" {
"**/route53_zone*"
]
"service/route53domains" = [
"**/*_route53_domains_*",
"**/route53_domains_*"
"**/*_route53domains_*",
"**/route53domains_*"
]
"service/route53resolver" = [
"**/*_route53_resolver_*",
Expand Down
Loading

0 comments on commit f12736e

Please sign in to comment.