--- layout: "aws" page_title: "AWS: aws_iam_server_certificate" sidebar_current: "docs-aws-resource-iam-server-certificate" description: |- Provides an IAM Server Certificate --- # aws\_iam\_server\_certificate Provides an IAM Server Certificate resource to upload Server Certificates. Certs uploaded to IAM can easily work with other AWS services such as: - AWS Elastic Beanstalk - Elastic Load Balancing - CloudFront - AWS OpsWorks For information about server certificates in IAM, see [Managing Server Certificates][2] in AWS Documentation. ~> **Note:** All arguments including the private key will be stored in the raw state as plain-text. [Read more about sensitive data in state](/docs/state/sensitive-data.html). ## Example Usage **Using certs on file:** ```hcl resource "aws_iam_server_certificate" "test_cert" { name = "some_test_cert" certificate_body = "${file("self-ca-cert.pem")}" private_key = "${file("test-key.pem")}" } ``` **Example with cert in-line:** ```hcl resource "aws_iam_server_certificate" "test_cert_alt" { name = "alt_test_cert" certificate_body = < **NOTE:** AWS performs behind-the-scenes modifications to some certificate files if they do not adhere to a specific format. These modifications will result in terraform forever believing that it needs to update the resources since the local and AWS file contents will not match after theses modifications occur. In order to prevent this from happening you must ensure that all your PEM-encoded files use UNIX line-breaks and that `certificate_body` contains only one certificate. All other certificates should go in `certificate_chain`. It is common for some Certificate Authorities to issue certificate files that have DOS line-breaks and that are actually multiple certificates concatenated together in order to form a full certificate chain. ## Attributes Reference * `id` - The unique Server Certificate name * `name` - The name of the Server Certificate * `arn` - The Amazon Resource Name (ARN) specifying the server certificate. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingServerCerts.html [lifecycle]: /docs/configuration/resources.html