Manage Terraform scripts. Automatically.
What is this?
This project implements a Rewrite module that performs common tasks when managing Terraform scripts.
This project implements a Rewrite module that performs common tasks when managing Terraform scripts.
Change type information on variables from "map"
to become "map(string)"
on all equivalent collection types.
That is:
map
-> map(string)
list
-> list(string)
((?) set
-> set(string)
unsure of type set
)
If the upgrade0.12
terraform cli command is used as reference, we can just assume all upgraded types will become X(string)
. As per https://github.com/hashicorp/terraform/blob/ffe5f7c4e60b8d759b1251ce81a2cb44c7190b8f/configs/configupgrade/upgrade_native.go#L115-L129
Changing type information referencing vpc_id = "${element(concat(aws_vpc.this.*.id, list("")), 0)}"
to vpc_id = element(concat(aws_vpc.this.*.id, [""]), 0)
-- note the change of list("")
to [""]
Work in progress, using this issue as a placeholder.
Note, many of these examples come from running terraform 0.12upgrade -yes -force
on terraform-aws-vpc@v1.73.0
Things to be done:
variable
, output
, locals
, data
, etc, separately from one another
ChangeVariableName
. The thing that's unnerving about this is that often a variable name change will involve destroying/recreating a resource of some sort. But, that's just off my memory. Not sure how true that is.vpc_id = "${aws_vpc.this.id}"
becomes vpc_id = aws_vpc.this[0].id
ingress = "${var.default_network_acl_ingress}"
changing to a dynamic
block, e.g. dynamic "ingress" {...
nat_gateway_ips = "${split(",", (var.reuse_nat_ips ? join(",", var.external_nat_ip_ids) : join(",", aws_eip.nat.*.id)))}"
-> nat_gateway_ips = split(",",var.reuse_nat_ips ? join(",", var.external_nat_ip_ids) : join(",", aws_eip.nat.*.id))
For helpful cross-reference, see:
Bumps styfle/cancel-workflow-action from 0.8.0 to 0.9.1.
Sourced from styfle/cancel-workflow-action's releases.
0.9.1
Patches
- Fix: cancelling jobs from different repos where two branches have the same name: #105
- Fix: use getBooleanInput instead of getInput: #92
- Chore: add permissions configuration in the README.md: #96
- Chore: add prettier config, format file, add lint workflow: #63
- Chore: create
dependabot.yml
: #68- Bump typescript from 4.1.5 to 4.2.4: #71
- Bump actions/setup-node requirement to v2.1.5: #69
- Bump
@vercel/ncc
to 0.28.3: #73- Bump
@actions/core
from 1.2.6 to 1.2.7: #74- Bump
@vercel/ncc
from 0.28.3 to 0.28.5: #81- Bump
@actions/core
from 1.2.7 to 1.3.0: #90- Bump prettier from 2.2.1 to 2.3.0: #85
- Bump
@vercel/ncc
from 0.28.5 to 0.28.6: #95- Bump typescript from 4.2.4 to 4.3.2: #94
- Bump prettier from 2.3.0 to 2.3.1: #97
- Bump typescript from 4.3.2 to 4.3.4: #99
- Bump prettier from 2.3.1 to 2.3.2: #100
- Bump typescript from 4.3.4 to 4.3.5: #101
- Bump husky from 6.0.0 to 7.0.0: #102
- Bump husky from 7.0.0 to 7.0.1: #103
Credits
Huge thanks to
@mikehardy
,@MichaelDeBoey
,@Warashi
,@adrienbernede
, and@spaceface777
for helping!0.9.0
Minor Changes
Credits
Huge thanks to
@thomwiggers
for helping!
a40b884
0.9.1a66ae1f
fix cancelling jobs from different repos where two branches have the same nam...b54f1a5
Bump husky from 7.0.0 to 7.0.1 (#103)cc6225c
Bump husky from 6.0.0 to 7.0.0 (#102)c94109d
Bump typescript from 4.3.4 to 4.3.5 (#101)fc3581b
Bump prettier from 2.3.1 to 2.3.2 (#100)6f9f8b4
Bump typescript from 4.3.2 to 4.3.4 (#99)6135c0f
Bump prettier from 2.3.0 to 2.3.1 (#97)531a036
chore: add permissions configuration in the README.md (#96)1f10757
Bump typescript from 4.2.4 to 4.3.2 (#94)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Scooting content along. See individual commit lines. Part of https://github.com/openrewrite/rewrite-terraform/issues/1
Includes content addressing
As per https://github.com/hashicorp/terraform/commit/26c1e40ad775297cc89b32794508f4d596615d5a
before:
locals {
decimal_int = 1
decimal_float = 1.5
decimal_float_tricky = 0.1
hex_int = 0xff
octal_int = 0777
}
after:
locals {
decimal_int = 1
decimal_float = 1.5
decimal_float_tricky = 0.1
hex_int = 255
octal_int = 511
}
wontfix
Similar to FindResource, this requires FindVariable
:
https://www.terraform.io/upgrade-guides/0-12.html#reserved-variable-names
In preparation for new features planned for future releases, Terraform 0.12 reserves some additional names that can no longer be used as input variable names for modules. These reserved names are:
count
depends_on
for_each
lifecycle
providers
source
When any of these names is used as the label of a variable block, Terraform will now generate the following error:
Error: Invalid variable name
on reserved-variable-names.tf line 2, in variable "count": 2: variable "count" {
good first issue wontfixThe variable name "count" is reserved due to its special meaning inside module blocks.
Continuing to refine structure, etc.
Part of https://github.com/openrewrite/rewrite-terraform/issues/5 Part of https://github.com/openrewrite/rewrite-terraform/issues/1
Starts the ball rolling. Putting out scaffolding.
Part of https://github.com/openrewrite/rewrite-terraform/issues/1 Part of https://github.com/openrewrite/rewrite-terraform/issues/6
enhancementReplacement of !
for "false" with false
, e.g. count = "${var.create_vpc && (var.enable_nat_gateway && ! var.reuse_nat_ips) ? local.nat_gateway_count : 0}"
becomes count = var.create_vpc && var.enable_nat_gateway && false == var.reuse_nat_ips ? local.nat_gateway_count : 0
Changing referencing of functions on lookup
, e.g. rule_number = "${lookup(var.public_inbound_acl_rules[count.index], "rule_number")}"
becomes rule_number = var.public_inbound_acl_rules[count.index]["rule_number"]
Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.14.0...v1.15.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.13.0...v1.14.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.10.0...v1.13.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v.1.7.0...v1.12.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v.1.7.0...v1.11.1
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v.1.7.0...v1.10.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.6.0...v1.9.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.6.0...v1.9.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.6.0...v1.8.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.6.0...v.1.7.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.3.0...v1.6.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/V1.1.0...v1.4.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/V1.1.0...v1.3.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.0.0...v1.2.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v1.0.0...v1.1.0
Source code(tar.gz)Full Changelog: https://github.com/openrewrite/rewrite-terraform/compare/v0.8.0...v1.0.0
Source code(tar.gz)Enhancements:
Enhancements:
Enhancements:
Enhancements:
Enhancements:
AWS
, GCP
, and Azure
IaaSes, such as Ensure IAM password policy requires at least one uppercase letter
, Encrypt EBS volumes
, Encrypt Azure VM data disk with ADE/CMK
, Ensure GCP Kubernetes cluster node auto-repair configuration is enabled
, and many more.
Enhancements:
• Updated with rewrite 7.11.0
Source code(tar.gz)Enhancements: • Updated with rewrite 7.10.0
Source code(tar.gz)Enhancements:
AutoFitTextView A TextView that automatically resizes text to fit perfectly within its bounds. Usage dependencies { compile 'me.grantland:autofitt
#BaseAnimation (below chart) #动画合集 (下面有效果图)修改分支 主干 English Description BaseAnimation network Android animation set, custom controls, nearly 200 kinds
QuickSand When showing a really enchanting explanatory animation to your users, but you know that after a while it'll get tedious and would stop users
ParallaxScrollingView Parallax Scrolling View. automatic scrolling with different speeds minimal integration gpu accelerated supports vector drawables
UserAwareVideoView Featured in: Medium What is this library for? UserAwareVideoView is a customizable VideoView that smartly play and pause the video
SelectorChapek for Android This Android Studio plugin automatically generates drawable selectors from appropriately named Android resources. How to in
AutoFitTextView A TextView that automatically resizes text to fit perfectly within its bounds. Usage dependencies { compile 'me.grantland:autofitt
AutoLinkTextView Deprecated Please use the new version of AutoLinkTextView AutoLinkTextView is TextView that supports Hashtags (#), Mentions (@) , URL
Trail Trail is a simple logging system for Java and Android. Create logs using the same API and the library will detect automatically in which platfor
AutoFitTextView A TextView that automatically fit its font and line count based on its available size and content This code is heavily based on this S
FadingTextView A TextView that changes its content automatically every few seconds Demo app A demo app is available on Google Play: Usage Add this to
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes
custom-image-list-item Examples of custom RecyclerView items using Data Binding Features: Loading images urls with the help of a Picasso library Autom
A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.
[TOC] Moshi-kotlin-nullsafe 中文版 1. moshi-kotlin moshi-kotlin support kotlin type safe check. When parsing json, fields declared as non-null types may
Plex Auto Trash Automatically empty the trash in all of your Plex libraries. If you disable automatic trash emptying (and you probably should) trash s
AutoDND Just a simple tool to turn on/off DND(Do Not Disturb) automatically when using specified apps. Ever feel disturbed by notifications and maybe
An android app will start when boot and exit after 1s. Develop for Redmi K40 to enable DC dimming automatically.
Automatically generates UI demos which allow users to call any function (including composable ones) with any parameters. Useful for building demo screens in playground apps of various design systems.
Croissant Attend HoYoLAB Check-in events automatically https://play.google.com/store/apps/details?id=com.joeloewi.croissant Stacks Room Database Hilt