Skip to content

Commit 22c479d

Browse files
workflow: GHA and text update in end user documentation highlight the resources/data-source count. (hashicorp#32387)
* resource count action on updated index * add newline * add cron to trigger on wed 9AM * correct cron * remove space
1 parent 8228562 commit 22c479d

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

Diff for: .github/workflows/resource-counts.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Resource Counts
2+
on:
3+
workflow_dispatch: {}
4+
schedule:
5+
- cron: '0 9 * * WED'
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
coverage:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
14+
- run: |
15+
touch main.tf
16+
cat << EOF > main.tf
17+
terraform {
18+
required_providers {
19+
aws = {
20+
source = "hashicorp/aws"
21+
}
22+
}
23+
}
24+
EOF
25+
- run: terraform init
26+
- run: |
27+
datasources=$(terraform providers schema -json | jq '.provider_schemas[] .data_source_schemas | length')
28+
resources=$(terraform providers schema -json | jq '.provider_schemas[] .resource_schemas | length')
29+
sed -r -i "s/There are currently ([0-9]+) resources and ([0-9]+)(.*)/There are currently $resources resources and $datasources\3/" website/docs/index.html.markdown
30+
- run: |
31+
rm main.tf
32+
rm .terraform.lock.hcl
33+
rm -rf .terraform
34+
- name: Create Pull Request
35+
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
36+
with:
37+
branch: "resource-counts"
38+
commit-message: "docs: update resource counts"
39+
title: "docs: update resource counts"
40+
body: "This PR updates the resource/data source counts included on the provider documentation index page."

Diff for: website/docs/index.html.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Use the Amazon Web Services (AWS) provider to interact with the
1111
many resources supported by AWS. You must configure the provider
1212
with the proper credentials before you can use it.
1313

14-
Use the navigation to the left to read about the available resources.
14+
Use the navigation to the left to read about the available resources. There are currently 1234 resources and 507 data sources available in the provider.
1515

1616
To learn the basics of Terraform using this provider, follow the
1717
hands-on [get started tutorials](https://learn.hashicorp.com/tutorials/terraform/infrastructure-as-code?in=terraform/aws-get-started&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS). Interact with AWS services,

0 commit comments

Comments
 (0)