-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue where importing random_string & random_password is not writ…
…ing all defaults into TF state Co-authored-by: Benjamin Bennett <[email protected]>
- Loading branch information
1 parent
b8d7b4e
commit 4997b53
Showing
9 changed files
with
245 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# Random Password can be imported by specifying the value of the string: | ||
# Random Password can be imported by specifying the value of the string. | ||
# | ||
# "**NOTE**: Any attribute values that are specified within TF config will be | ||
# ignored during import and all attributes that have defaults defined within | ||
# the schema will have the default assigned. | ||
# | ||
# For instance, using the following config during import: | ||
# ``` | ||
# resource "random_password" "password" { | ||
# length = 16 | ||
# lower = false | ||
# } | ||
# ``` | ||
# | ||
# Then importing the resource using: | ||
# `terraform import random_password.password securepassword` | ||
# | ||
# Would result in the triggering of a replacement (i.e., destroy-create) during | ||
# the next `terraform apply`. The replacement can be avoided by either using: | ||
# | ||
# 1. Attribute values that match the imported ID and defaults: | ||
# ``` | ||
# resource "random_password" "password" { | ||
# length = 14 | ||
# lower = true | ||
# } | ||
# ``` | ||
# | ||
# 2. Attribute values that match the imported ID and omit the attributes with defaults: | ||
# ``` | ||
# resource "random_password" "password" { | ||
# length = 14 | ||
# } | ||
# ``` | ||
# | ||
# 3. `ignore_changes` specifying the attributes to ignore: | ||
# ``` | ||
# resource "random_password" "password" { | ||
# length = 16 | ||
# lower = false | ||
# | ||
# lifecycle { | ||
# ignore_changes = [ | ||
# length, | ||
# lower, | ||
# ] | ||
# } | ||
# } | ||
# ``` | ||
terraform import random_password.password securepassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# Strings can be imported by just specifying the value of the string: | ||
# Strings can be imported by just specifying the value of the string. | ||
# | ||
# "**NOTE**: Any attribute values that are specified within TF config will be | ||
# ignored during import and all attributes that have defaults defined within | ||
# the schema will have the default assigned. | ||
# | ||
# For instance, using the following config during import: | ||
# ``` | ||
# resource "random_string" "test" { | ||
# length = 16 | ||
# lower = false | ||
# } | ||
# ``` | ||
# | ||
# Then importing the resource using: | ||
# `terraform import random_string.test test` | ||
# | ||
# Would result in the triggering of a replacement (i.e., destroy-create) during | ||
# the next `terraform apply`. The replacement can be avoided by either using: | ||
# | ||
# 1. Attribute values that match the imported ID and defaults: | ||
# ``` | ||
# resource "random_string" "test" { | ||
# length = 4 | ||
# lower = true | ||
# } | ||
# ``` | ||
# | ||
# 2. Attribute values that match the imported ID and omit the attributes with defaults: | ||
# ``` | ||
# resource "random_string" "test" { | ||
# length = 4 | ||
# } | ||
# ``` | ||
# | ||
# 3. `ignore_changes` specifying the attributes to ignore: | ||
# ``` | ||
# resource "random_string" "test" { | ||
# length = 16 | ||
# lower = false | ||
# | ||
# lifecycle { | ||
# ignore_changes = [ | ||
# length, | ||
# lower, | ||
# ] | ||
# } | ||
# } | ||
# ``` | ||
terraform import random_string.test test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters