Merge pull request #5887 from hashicorp/b-aws-iam-server-cert-docs
provider/aws: Document lifecycle block needs for IAM Server Certificate
This commit is contained in:
commit
7d1cfde490
|
@ -17,7 +17,7 @@ Certs uploaded to IAM can easily work with other AWS services such as:
|
|||
- AWS OpsWorks
|
||||
|
||||
For information about server certificates in IAM, see [Managing Server
|
||||
Certficates][2] in AWS Documentation.
|
||||
Certificates][2] in AWS Documentation.
|
||||
|
||||
## Example Usage
|
||||
|
||||
|
@ -52,11 +52,23 @@ EOF
|
|||
|
||||
**Use in combination with an AWS ELB resource:**
|
||||
|
||||
Some properties of an IAM Server Certificates cannot be updated while they are
|
||||
in use. In order for Terraform to effectively manage a Certificate in this situation, it is
|
||||
recommended you utilize the `name_prefix` attribute and enable the
|
||||
`create_before_destroy` [lifecycle block][lifecycle]. This will allow Terraform
|
||||
to create a new, updated `aws_iam_server_certificate` resource and replace it in
|
||||
dependant resources before attempting to destroy the old version.
|
||||
|
||||
|
||||
```
|
||||
resource "aws_iam_server_certificate" "test_cert" {
|
||||
name = "some_test_cert"
|
||||
name_prefix = "example-cert"
|
||||
certificate_body = "${file("self-ca-cert.pem")}"
|
||||
private_key = "${file("test-key.pem")}"
|
||||
|
||||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_elb" "ourapp" {
|
||||
|
@ -104,3 +116,5 @@ The following arguments are supported:
|
|||
|
||||
[1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
||||
[2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingServerCerts.html
|
||||
[lifecycle]: http://localhost:4567/docs/configuration/resources.html
|
||||
|
||||
|
|
Loading…
Reference in New Issue