Created
October 4, 2022 11:47
-
-
Save luispabon/ef9fecc29d19b6fd41561971e89a2a70 to your computer and use it in GitHub Desktop.
aws cli terraform import secret and secret version
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
~ terraform import aws_secretsmanager_secret.yep my_name | |
~ terraform import aws_secretsmanager_secret_version.yep my_name\|$(aws secretsmanager get-secret-value --secret-id=my_name | jq ".VersionId" --raw-output) |
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
resource "aws_secretsmanager_secret" "yep" { | |
name = "my_name" | |
recovery_window_in_days = 7 | |
} | |
resource "aws_secretsmanager_secret_version" "yep" { | |
secret_id = aws_secretsmanager_secret.yep.id | |
secret_string = jsonencode({}) | |
lifecycle { | |
ignore_changes = [secret_string] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment