Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Bennett <[email protected]>
  • Loading branch information
wakeful and bendbennett authored Jun 23, 2022
1 parent 7e6267e commit 822707c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 99 deletions.
50 changes: 1 addition & 49 deletions examples/resources/random_password/import.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,2 @@
# Random Password can be imported by specifying the value of the password.
#
# "**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,
# ]
# }
# }
# ```
# Random Password can be imported by specifying the value of the password.
terraform import random_password.password securepassword
50 changes: 1 addition & 49 deletions examples/resources/random_string/import.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,2 @@
# Random String 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_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,
# ]
# }
# }
# ```
# Random String can be imported by specifying the value of the string.
terraform import random_string.test test
2 changes: 1 addition & 1 deletion templates/resources/string.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-

## Example Usage

{{ tffile "examples/resources/random_password/resource.tf" }}
{{ tffile "examples/resources/random_string/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

Expand Down

0 comments on commit 822707c

Please sign in to comment.