ServerCertificate
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.
Example Usage
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var testCert = new Aws.Iam.ServerCertificate("testCert", new Aws.Iam.ServerCertificateArgs
{
CertificateBody = File.ReadAllText("self-ca-cert.pem"),
PrivateKey = File.ReadAllText("test-key.pem"),
});
}
}
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := iam.NewServerCertificate(ctx, "testCertAlt", &iam.ServerCertificateArgs{
CertificateBody: pulumi.String(fmt.Sprintf("%v%v%v%v", "-----BEGIN CERTIFICATE-----\n", "[......] # cert contents\n", "-----END CERTIFICATE-----\n", "\n")),
PrivateKey: pulumi.String(fmt.Sprintf("%v%v%v%v", "-----BEGIN RSA PRIVATE KEY-----\n", "[......] # cert contents\n", "-----END RSA PRIVATE KEY-----\n", "\n")),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
test_cert = aws.iam.ServerCertificate("testCert",
certificate_body=(lambda path: open(path).read())("self-ca-cert.pem"),
private_key=(lambda path: open(path).read())("test-key.pem"))import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const testCert = new aws.iam.ServerCertificate("test_cert", {
certificateBody: fs.readFileSync("self-ca-cert.pem", "utf-8"),
privateKey: fs.readFileSync("test-key.pem", "utf-8"),
});Create a ServerCertificate Resource
new ServerCertificate(name: string, args: ServerCertificateArgs, opts?: CustomResourceOptions);def ServerCertificate(resource_name, opts=None, arn=None, certificate_body=None, certificate_chain=None, name=None, name_prefix=None, path=None, private_key=None, __props__=None);func NewServerCertificate(ctx *Context, name string, args ServerCertificateArgs, opts ...ResourceOption) (*ServerCertificate, error)public ServerCertificate(string name, ServerCertificateArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ServerCertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServerCertificateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServerCertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ServerCertificate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ServerCertificate resource accepts the following input properties:
- Certificate
Body string The contents of the public key certificate in PEM-encoded format.
- Private
Key string The contents of the private key in PEM-encoded format.
- Arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- Certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- Name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.
- Certificate
Body string The contents of the public key certificate in PEM-encoded format.
- Private
Key string The contents of the private key in PEM-encoded format.
- Arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- Certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- Name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.
- certificate
Body string The contents of the public key certificate in PEM-encoded format.
- private
Key string The contents of the private key in PEM-encoded format.
- arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.
- certificate_
body str The contents of the public key certificate in PEM-encoded format.
- private_
key str The contents of the private key in PEM-encoded format.
- arn str
The Amazon Resource Name (ARN) specifying the server certificate.
- certificate_
chain str The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- name str
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- name_
prefix str Creates a unique name beginning with the specified prefix. Conflicts with
name.- path str
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServerCertificate resource produces the following output properties:
Look up an Existing ServerCertificate Resource
Get an existing ServerCertificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ServerCertificateState, opts?: CustomResourceOptions): ServerCertificatestatic get(resource_name, id, opts=None, arn=None, certificate_body=None, certificate_chain=None, name=None, name_prefix=None, path=None, private_key=None, __props__=None);func GetServerCertificate(ctx *Context, name string, id IDInput, state *ServerCertificateState, opts ...ResourceOption) (*ServerCertificate, error)public static ServerCertificate Get(string name, Input<string> id, ServerCertificateState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- Certificate
Body string The contents of the public key certificate in PEM-encoded format.
- Certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- Name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.- Private
Key string The contents of the private key in PEM-encoded format.
- Arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- Certificate
Body string The contents of the public key certificate in PEM-encoded format.
- Certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- Name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- Name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- Path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.- Private
Key string The contents of the private key in PEM-encoded format.
- arn string
The Amazon Resource Name (ARN) specifying the server certificate.
- certificate
Body string The contents of the public key certificate in PEM-encoded format.
- certificate
Chain string The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- name string
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- name
Prefix string Creates a unique name beginning with the specified prefix. Conflicts with
name.- path string
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.- private
Key string The contents of the private key in PEM-encoded format.
- arn str
The Amazon Resource Name (ARN) specifying the server certificate.
- certificate_
body str The contents of the public key certificate in PEM-encoded format.
- certificate_
chain str The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain.
- name str
The name of the Server Certificate. Do not include the path in this value. If omitted, this provider will assign a random, unique name.
- name_
prefix str Creates a unique name beginning with the specified prefix. Conflicts with
name.- path str
The IAM path for the server certificate. If it is not included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format
/cloudfront/your_path_here. See IAM Identifiers for more details on IAM Paths.- private_
key str The contents of the private key in PEM-encoded format.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.