1. Packages
  2. Fastly
  3. API Docs
  4. TlsPrivateKey
Fastly v8.5.1 published on Monday, Mar 18, 2024 by Pulumi

fastly.TlsPrivateKey

Explore with Pulumi AI

fastly logo
Fastly v8.5.1 published on Monday, Mar 18, 2024 by Pulumi

    Uploads a Custom TLS Private Key to Fastly. This can be combined with a fastly.TlsCertificate resource to provide a TLS Certificate able to be applied to a Fastly Service.

    The Private Key resource requires a key in PEM format, and a name to identify it.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as fastly from "@pulumi/fastly";
    import * as tls from "@pulumi/tls";
    
    const demoPrivateKey = new tls.PrivateKey("demoPrivateKey", {algorithm: "RSA"});
    const demoTlsPrivateKey = new fastly.TlsPrivateKey("demoTlsPrivateKey", {keyPem: demoPrivateKey.privateKeyPem});
    
    import pulumi
    import pulumi_fastly as fastly
    import pulumi_tls as tls
    
    demo_private_key = tls.PrivateKey("demoPrivateKey", algorithm="RSA")
    demo_tls_private_key = fastly.TlsPrivateKey("demoTlsPrivateKey", key_pem=demo_private_key.private_key_pem)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-fastly/sdk/v8/go/fastly"
    	"github.com/pulumi/pulumi-tls/sdk/v4/go/tls"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		demoPrivateKey, err := tls.NewPrivateKey(ctx, "demoPrivateKey", &tls.PrivateKeyArgs{
    			Algorithm: pulumi.String("RSA"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = fastly.NewTlsPrivateKey(ctx, "demoTlsPrivateKey", &fastly.TlsPrivateKeyArgs{
    			KeyPem: demoPrivateKey.PrivateKeyPem,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fastly = Pulumi.Fastly;
    using Tls = Pulumi.Tls;
    
    return await Deployment.RunAsync(() => 
    {
        var demoPrivateKey = new Tls.PrivateKey("demoPrivateKey", new()
        {
            Algorithm = "RSA",
        });
    
        var demoTlsPrivateKey = new Fastly.TlsPrivateKey("demoTlsPrivateKey", new()
        {
            KeyPem = demoPrivateKey.PrivateKeyPem,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tls.PrivateKey;
    import com.pulumi.tls.PrivateKeyArgs;
    import com.pulumi.fastly.TlsPrivateKey;
    import com.pulumi.fastly.TlsPrivateKeyArgs;
    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 demoPrivateKey = new PrivateKey("demoPrivateKey", PrivateKeyArgs.builder()        
                .algorithm("RSA")
                .build());
    
            var demoTlsPrivateKey = new TlsPrivateKey("demoTlsPrivateKey", TlsPrivateKeyArgs.builder()        
                .keyPem(demoPrivateKey.privateKeyPem())
                .build());
    
        }
    }
    
    resources:
      demoPrivateKey:
        type: tls:PrivateKey
        properties:
          algorithm: RSA
      demoTlsPrivateKey:
        type: fastly:TlsPrivateKey
        properties:
          keyPem: ${demoPrivateKey.privateKeyPem}
    

    Create TlsPrivateKey Resource

    new TlsPrivateKey(name: string, args: TlsPrivateKeyArgs, opts?: CustomResourceOptions);
    @overload
    def TlsPrivateKey(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      key_pem: Optional[str] = None,
                      name: Optional[str] = None)
    @overload
    def TlsPrivateKey(resource_name: str,
                      args: TlsPrivateKeyArgs,
                      opts: Optional[ResourceOptions] = None)
    func NewTlsPrivateKey(ctx *Context, name string, args TlsPrivateKeyArgs, opts ...ResourceOption) (*TlsPrivateKey, error)
    public TlsPrivateKey(string name, TlsPrivateKeyArgs args, CustomResourceOptions? opts = null)
    public TlsPrivateKey(String name, TlsPrivateKeyArgs args)
    public TlsPrivateKey(String name, TlsPrivateKeyArgs args, CustomResourceOptions options)
    
    type: fastly:TlsPrivateKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args TlsPrivateKeyArgs
    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 TlsPrivateKeyArgs
    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 TlsPrivateKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TlsPrivateKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TlsPrivateKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TlsPrivateKey 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 TlsPrivateKey resource accepts the following input properties:

    KeyPem string
    Private key in PEM format.
    Name string
    Customisable name of the private key.
    KeyPem string
    Private key in PEM format.
    Name string
    Customisable name of the private key.
    keyPem String
    Private key in PEM format.
    name String
    Customisable name of the private key.
    keyPem string
    Private key in PEM format.
    name string
    Customisable name of the private key.
    key_pem str
    Private key in PEM format.
    name str
    Customisable name of the private key.
    keyPem String
    Private key in PEM format.
    name String
    Customisable name of the private key.

    Outputs

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

    CreatedAt string
    Time-stamp (GMT) when the private key was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyLength int
    The key length used to generate the private key.
    KeyType string
    The algorithm used to generate the private key. Must be RSA.
    PublicKeySha1 string
    Useful for safely identifying the key.
    Replace bool
    Whether Fastly recommends replacing this private key.
    CreatedAt string
    Time-stamp (GMT) when the private key was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyLength int
    The key length used to generate the private key.
    KeyType string
    The algorithm used to generate the private key. Must be RSA.
    PublicKeySha1 string
    Useful for safely identifying the key.
    Replace bool
    Whether Fastly recommends replacing this private key.
    createdAt String
    Time-stamp (GMT) when the private key was created.
    id String
    The provider-assigned unique ID for this managed resource.
    keyLength Integer
    The key length used to generate the private key.
    keyType String
    The algorithm used to generate the private key. Must be RSA.
    publicKeySha1 String
    Useful for safely identifying the key.
    replace Boolean
    Whether Fastly recommends replacing this private key.
    createdAt string
    Time-stamp (GMT) when the private key was created.
    id string
    The provider-assigned unique ID for this managed resource.
    keyLength number
    The key length used to generate the private key.
    keyType string
    The algorithm used to generate the private key. Must be RSA.
    publicKeySha1 string
    Useful for safely identifying the key.
    replace boolean
    Whether Fastly recommends replacing this private key.
    created_at str
    Time-stamp (GMT) when the private key was created.
    id str
    The provider-assigned unique ID for this managed resource.
    key_length int
    The key length used to generate the private key.
    key_type str
    The algorithm used to generate the private key. Must be RSA.
    public_key_sha1 str
    Useful for safely identifying the key.
    replace bool
    Whether Fastly recommends replacing this private key.
    createdAt String
    Time-stamp (GMT) when the private key was created.
    id String
    The provider-assigned unique ID for this managed resource.
    keyLength Number
    The key length used to generate the private key.
    keyType String
    The algorithm used to generate the private key. Must be RSA.
    publicKeySha1 String
    Useful for safely identifying the key.
    replace Boolean
    Whether Fastly recommends replacing this private key.

    Look up Existing TlsPrivateKey Resource

    Get an existing TlsPrivateKey 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?: TlsPrivateKeyState, opts?: CustomResourceOptions): TlsPrivateKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            key_length: Optional[int] = None,
            key_pem: Optional[str] = None,
            key_type: Optional[str] = None,
            name: Optional[str] = None,
            public_key_sha1: Optional[str] = None,
            replace: Optional[bool] = None) -> TlsPrivateKey
    func GetTlsPrivateKey(ctx *Context, name string, id IDInput, state *TlsPrivateKeyState, opts ...ResourceOption) (*TlsPrivateKey, error)
    public static TlsPrivateKey Get(string name, Input<string> id, TlsPrivateKeyState? state, CustomResourceOptions? opts = null)
    public static TlsPrivateKey get(String name, Output<String> id, TlsPrivateKeyState 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:
    CreatedAt string
    Time-stamp (GMT) when the private key was created.
    KeyLength int
    The key length used to generate the private key.
    KeyPem string
    Private key in PEM format.
    KeyType string
    The algorithm used to generate the private key. Must be RSA.
    Name string
    Customisable name of the private key.
    PublicKeySha1 string
    Useful for safely identifying the key.
    Replace bool
    Whether Fastly recommends replacing this private key.
    CreatedAt string
    Time-stamp (GMT) when the private key was created.
    KeyLength int
    The key length used to generate the private key.
    KeyPem string
    Private key in PEM format.
    KeyType string
    The algorithm used to generate the private key. Must be RSA.
    Name string
    Customisable name of the private key.
    PublicKeySha1 string
    Useful for safely identifying the key.
    Replace bool
    Whether Fastly recommends replacing this private key.
    createdAt String
    Time-stamp (GMT) when the private key was created.
    keyLength Integer
    The key length used to generate the private key.
    keyPem String
    Private key in PEM format.
    keyType String
    The algorithm used to generate the private key. Must be RSA.
    name String
    Customisable name of the private key.
    publicKeySha1 String
    Useful for safely identifying the key.
    replace Boolean
    Whether Fastly recommends replacing this private key.
    createdAt string
    Time-stamp (GMT) when the private key was created.
    keyLength number
    The key length used to generate the private key.
    keyPem string
    Private key in PEM format.
    keyType string
    The algorithm used to generate the private key. Must be RSA.
    name string
    Customisable name of the private key.
    publicKeySha1 string
    Useful for safely identifying the key.
    replace boolean
    Whether Fastly recommends replacing this private key.
    created_at str
    Time-stamp (GMT) when the private key was created.
    key_length int
    The key length used to generate the private key.
    key_pem str
    Private key in PEM format.
    key_type str
    The algorithm used to generate the private key. Must be RSA.
    name str
    Customisable name of the private key.
    public_key_sha1 str
    Useful for safely identifying the key.
    replace bool
    Whether Fastly recommends replacing this private key.
    createdAt String
    Time-stamp (GMT) when the private key was created.
    keyLength Number
    The key length used to generate the private key.
    keyPem String
    Private key in PEM format.
    keyType String
    The algorithm used to generate the private key. Must be RSA.
    name String
    Customisable name of the private key.
    publicKeySha1 String
    Useful for safely identifying the key.
    replace Boolean
    Whether Fastly recommends replacing this private key.

    Import

    A Private Key can be imported using its ID, e.g.

    $ pulumi import fastly:index/tlsPrivateKey:TlsPrivateKey demo xxxxxxxxxxx
    

    Package Details

    Repository
    Fastly pulumi/pulumi-fastly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the fastly Terraform Provider.
    fastly logo
    Fastly v8.5.1 published on Monday, Mar 18, 2024 by Pulumi