1. Packages
  2. AWS
  3. API Docs
  4. iot
  5. Certificate
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

aws.iot.Certificate

Explore with Pulumi AI

aws logo
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

    Creates and manages an AWS IoT certificate.

    Example Usage

    With CSR

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as std from "@pulumi/std";
    
    const cert = new aws.iot.Certificate("cert", {
        csr: std.file({
            input: "/my/csr.pem",
        }).then(invoke => invoke.result),
        active: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_std as std
    
    cert = aws.iot.Certificate("cert",
        csr=std.file(input="/my/csr.pem").result,
        active=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "/my/csr.pem",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = iot.NewCertificate(ctx, "cert", &iot.CertificateArgs{
    			Csr:    pulumi.String(invokeFile.Result),
    			Active: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var cert = new Aws.Iot.Certificate("cert", new()
        {
            Csr = Std.File.Invoke(new()
            {
                Input = "/my/csr.pem",
            }).Apply(invoke => invoke.Result),
            Active = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iot.Certificate;
    import com.pulumi.aws.iot.CertificateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var cert = new Certificate("cert", CertificateArgs.builder()
                .csr(StdFunctions.file(FileArgs.builder()
                    .input("/my/csr.pem")
                    .build()).result())
                .active(true)
                .build());
    
        }
    }
    
    resources:
      cert:
        type: aws:iot:Certificate
        properties:
          csr:
            fn::invoke:
              Function: std:file
              Arguments:
                input: /my/csr.pem
              Return: result
          active: true
    

    Without CSR

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const cert = new aws.iot.Certificate("cert", {active: true});
    
    import pulumi
    import pulumi_aws as aws
    
    cert = aws.iot.Certificate("cert", active=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iot.NewCertificate(ctx, "cert", &iot.CertificateArgs{
    			Active: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var cert = new Aws.Iot.Certificate("cert", new()
        {
            Active = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iot.Certificate;
    import com.pulumi.aws.iot.CertificateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var cert = new Certificate("cert", CertificateArgs.builder()
                .active(true)
                .build());
    
        }
    }
    
    resources:
      cert:
        type: aws:iot:Certificate
        properties:
          active: true
    

    From existing certificate without a CA

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as std from "@pulumi/std";
    
    const cert = new aws.iot.Certificate("cert", {
        certificatePem: std.file({
            input: "/my/cert.pem",
        }).then(invoke => invoke.result),
        active: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_std as std
    
    cert = aws.iot.Certificate("cert",
        certificate_pem=std.file(input="/my/cert.pem").result,
        active=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "/my/cert.pem",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = iot.NewCertificate(ctx, "cert", &iot.CertificateArgs{
    			CertificatePem: pulumi.String(invokeFile.Result),
    			Active:         pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var cert = new Aws.Iot.Certificate("cert", new()
        {
            CertificatePem = Std.File.Invoke(new()
            {
                Input = "/my/cert.pem",
            }).Apply(invoke => invoke.Result),
            Active = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.iot.Certificate;
    import com.pulumi.aws.iot.CertificateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var cert = new Certificate("cert", CertificateArgs.builder()
                .certificatePem(StdFunctions.file(FileArgs.builder()
                    .input("/my/cert.pem")
                    .build()).result())
                .active(true)
                .build());
    
        }
    }
    
    resources:
      cert:
        type: aws:iot:Certificate
        properties:
          certificatePem:
            fn::invoke:
              Function: std:file
              Arguments:
                input: /my/cert.pem
              Return: result
          active: true
    

    Create Certificate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
    @overload
    def Certificate(resource_name: str,
                    args: CertificateArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Certificate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    active: Optional[bool] = None,
                    ca_pem: Optional[str] = None,
                    certificate_pem: Optional[str] = None,
                    csr: Optional[str] = None)
    func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
    public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
    public Certificate(String name, CertificateArgs args)
    public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
    
    type: aws:iot:Certificate
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var examplecertificateResourceResourceFromIotcertificate = new Aws.Iot.Certificate("examplecertificateResourceResourceFromIotcertificate", new()
    {
        Active = false,
        CaPem = "string",
        CertificatePem = "string",
        Csr = "string",
    });
    
    example, err := iot.NewCertificate(ctx, "examplecertificateResourceResourceFromIotcertificate", &iot.CertificateArgs{
    	Active:         pulumi.Bool(false),
    	CaPem:          pulumi.String("string"),
    	CertificatePem: pulumi.String("string"),
    	Csr:            pulumi.String("string"),
    })
    
    var examplecertificateResourceResourceFromIotcertificate = new Certificate("examplecertificateResourceResourceFromIotcertificate", CertificateArgs.builder()
        .active(false)
        .caPem("string")
        .certificatePem("string")
        .csr("string")
        .build());
    
    examplecertificate_resource_resource_from_iotcertificate = aws.iot.Certificate("examplecertificateResourceResourceFromIotcertificate",
        active=False,
        ca_pem="string",
        certificate_pem="string",
        csr="string")
    
    const examplecertificateResourceResourceFromIotcertificate = new aws.iot.Certificate("examplecertificateResourceResourceFromIotcertificate", {
        active: false,
        caPem: "string",
        certificatePem: "string",
        csr: "string",
    });
    
    type: aws:iot:Certificate
    properties:
        active: false
        caPem: string
        certificatePem: string
        csr: string
    

    Certificate Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Certificate resource accepts the following input properties:

    Active bool
    Boolean flag to indicate if the certificate should be active
    CaPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    CertificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    Csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    Active bool
    Boolean flag to indicate if the certificate should be active
    CaPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    CertificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    Csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    active Boolean
    Boolean flag to indicate if the certificate should be active
    caPem String
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem String
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr String
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    active boolean
    Boolean flag to indicate if the certificate should be active
    caPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    active bool
    Boolean flag to indicate if the certificate should be active
    ca_pem str
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificate_pem str
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr str
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    active Boolean
    Boolean flag to indicate if the certificate should be active
    caPem String
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem String
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr String
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Certificate resource produces the following output properties:

    Arn string
    The ARN of the created certificate.
    CaCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateKey string
    When neither CSR nor certificate is provided, the private key.
    PublicKey string
    When neither CSR nor certificate is provided, the public key.
    Arn string
    The ARN of the created certificate.
    CaCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateKey string
    When neither CSR nor certificate is provided, the private key.
    PublicKey string
    When neither CSR nor certificate is provided, the public key.
    arn String
    The ARN of the created certificate.
    caCertificateId String
    The certificate ID of the CA certificate used to sign the certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    privateKey String
    When neither CSR nor certificate is provided, the private key.
    publicKey String
    When neither CSR nor certificate is provided, the public key.
    arn string
    The ARN of the created certificate.
    caCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    id string
    The provider-assigned unique ID for this managed resource.
    privateKey string
    When neither CSR nor certificate is provided, the private key.
    publicKey string
    When neither CSR nor certificate is provided, the public key.
    arn str
    The ARN of the created certificate.
    ca_certificate_id str
    The certificate ID of the CA certificate used to sign the certificate.
    id str
    The provider-assigned unique ID for this managed resource.
    private_key str
    When neither CSR nor certificate is provided, the private key.
    public_key str
    When neither CSR nor certificate is provided, the public key.
    arn String
    The ARN of the created certificate.
    caCertificateId String
    The certificate ID of the CA certificate used to sign the certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    privateKey String
    When neither CSR nor certificate is provided, the private key.
    publicKey String
    When neither CSR nor certificate is provided, the public key.

    Look up Existing Certificate Resource

    Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            active: Optional[bool] = None,
            arn: Optional[str] = None,
            ca_certificate_id: Optional[str] = None,
            ca_pem: Optional[str] = None,
            certificate_pem: Optional[str] = None,
            csr: Optional[str] = None,
            private_key: Optional[str] = None,
            public_key: Optional[str] = None) -> Certificate
    func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
    public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
    public static Certificate get(String name, Output<String> id, CertificateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    Active bool
    Boolean flag to indicate if the certificate should be active
    Arn string
    The ARN of the created certificate.
    CaCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    CaPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    CertificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    Csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    PrivateKey string
    When neither CSR nor certificate is provided, the private key.
    PublicKey string
    When neither CSR nor certificate is provided, the public key.
    Active bool
    Boolean flag to indicate if the certificate should be active
    Arn string
    The ARN of the created certificate.
    CaCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    CaPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    CertificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    Csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    PrivateKey string
    When neither CSR nor certificate is provided, the private key.
    PublicKey string
    When neither CSR nor certificate is provided, the public key.
    active Boolean
    Boolean flag to indicate if the certificate should be active
    arn String
    The ARN of the created certificate.
    caCertificateId String
    The certificate ID of the CA certificate used to sign the certificate.
    caPem String
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem String
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr String
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    privateKey String
    When neither CSR nor certificate is provided, the private key.
    publicKey String
    When neither CSR nor certificate is provided, the public key.
    active boolean
    Boolean flag to indicate if the certificate should be active
    arn string
    The ARN of the created certificate.
    caCertificateId string
    The certificate ID of the CA certificate used to sign the certificate.
    caPem string
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem string
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr string
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    privateKey string
    When neither CSR nor certificate is provided, the private key.
    publicKey string
    When neither CSR nor certificate is provided, the public key.
    active bool
    Boolean flag to indicate if the certificate should be active
    arn str
    The ARN of the created certificate.
    ca_certificate_id str
    The certificate ID of the CA certificate used to sign the certificate.
    ca_pem str
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificate_pem str
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr str
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    private_key str
    When neither CSR nor certificate is provided, the private key.
    public_key str
    When neither CSR nor certificate is provided, the public key.
    active Boolean
    Boolean flag to indicate if the certificate should be active
    arn String
    The ARN of the created certificate.
    caCertificateId String
    The certificate ID of the CA certificate used to sign the certificate.
    caPem String
    The CA certificate for the certificate to be registered. If this is set, the CA needs to be registered with AWS IoT beforehand.
    certificatePem String
    The certificate to be registered. If ca_pem is unspecified, review RegisterCertificateWithoutCA. If ca_pem is specified, review RegisterCertificate for more information on registering a certificate.
    csr String
    The certificate signing request. Review CreateCertificateFromCsr for more information on generating a certificate from a certificate signing request (CSR). If none is specified both the certificate and keys will be generated, review CreateKeysAndCertificate for more information on generating keys and a certificate.
    privateKey String
    When neither CSR nor certificate is provided, the private key.
    publicKey String
    When neither CSR nor certificate is provided, the public key.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi