Skip to content

Commit

Permalink
Upgrade to v4 aws provider (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored Feb 22, 2022
1 parent f61532b commit 03a9738
Show file tree
Hide file tree
Showing 15 changed files with 526 additions and 199 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/auto-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "auto-readme"
on:
schedule:
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed

# Update README.md nightly at 4am UTC
- cron: '0 4 * * *'

jobs:
update:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Update readme
shell: bash
id: update
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
make init
make readme/build
# Ignore changes if they are only whitespace
git diff --ignore-all-space --ignore-blank-lines --quiet README.md && { git restore README.md; echo Ignoring whitespace-only changes in README; }
- name: Create Pull Request
# This action will not create or change a pull request if there are no changes to make.
# If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR.
uses: cloudposse/actions/github/[email protected]
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
commit-message: Update README.md and docs
title: Update README.md and docs
body: |-
## what
This is an auto-generated PR that updates the README.md and docs
## why
To have most recent changes of README.md and doc from origin templates
branch: auto-update/readme
base: main
delete-branch: true
labels: |
auto-update
no-release
readme
6 changes: 4 additions & 2 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ jobs:
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- uses: mszostok/codeowners-validator@v0.5.0
- uses: mszostok/codeowners-validator@v0.7.1
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
with:
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
# checks: "files,syntax,owners,duppatterns"
checks: "syntax,owners,duppatterns"
owner_checker_allow_unowned_patterns: "false"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
- uses: mszostok/codeowners-validator@v0.5.0
- uses: mszostok/codeowners-validator@v0.7.1
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
with:
checks: "syntax,duppatterns"
owner_checker_allow_unowned_patterns: "false"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
# Build harness files
.build-harness
build-harness

# Editor and merge files
*.orig
*.draft
*~
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL := /bin/bash
export TERRAFORM_VERSION = 0.12.3
export TERRAFORM_VERSION = 1.1.6

# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md docs/terraform.md
Expand Down
26 changes: 20 additions & 6 deletions README.md

Large diffs are not rendered by default.

26 changes: 20 additions & 6 deletions docs/terraform.md

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ variable "grants" {

variable "lifecycle_rules" {
type = list(object({
enabled = bool
prefix = string
enabled = bool
tags = map(string)

enable_glacier_transition = bool
Expand All @@ -39,8 +39,8 @@ variable "lifecycle_rules" {
expiration_days = number
}))
default = [{
enabled = false
prefix = ""
enabled = false
tags = {}

enable_glacier_transition = true
Expand Down Expand Up @@ -72,7 +72,13 @@ variable "s3_replication_enabled" {
variable "policy" {
type = string
default = ""
description = "A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy"
description = "DEPRECATED: Use source_policy_documents instead. A valid bucket policy JSON document. Note that if the policy document is not specific enough (but still valid), Terraform may view the policy as constantly changing in a terraform plan. In this case, please make sure you use the verbose/specific version of the policy"
}

variable "source_policy_documents" {
type = list(string)
default = null
description = "List of IAM policy documents that are merged together into the exported document. Statements defined in source_policy_documents or source_json must have unique sids. Statements with the same sid from documents assigned to the override_json and override_policy_documents arguments will override source statements."
}

variable "region" {
Expand Down Expand Up @@ -256,4 +262,4 @@ variable "bucket_key_enabled" {
For more information, see: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-key.html
EOT
}
}
14 changes: 14 additions & 0 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terraform {
required_version = ">= 0.13.0"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0.0"
}
time = {
source = "hashicorp/time"
version = ">= 0.7"
}
}
}
Loading

0 comments on commit 03a9738

Please sign in to comment.