1. Packages
  2. Heroku Provider
  3. API Docs
  4. ssl
  5. Ssl
Heroku v1.0.4 published on Tuesday, Apr 8, 2025 by pulumiverse - Marcel Arns

heroku.ssl.Ssl

Explore with Pulumi AI

heroku logo
Heroku v1.0.4 published on Tuesday, Apr 8, 2025 by pulumiverse - Marcel Arns

    This resource manages an SSL certificate for a Heroku app.

    IMPORTANT! This resource renders the “private_key” attribute in plain-text in your state file. Please ensure that your state file is properly secured and encrypted at rest.

    Example Usage

    # Create a new Heroku app
    resource "heroku_app" "default" {
      name = "test-app"
      region = "us"
    }
    
    # Build a slug that we can scale
    resource "heroku_build" "default" {
      app_id = heroku_app.default.id
      source {
        url = "https://github.com/heroku/terraform-provider-heroku/raw/master/heroku/test-fixtures/app.tgz"
      }
    }
    
    # Scale the app to a tier that supports Heroku SSL
    resource "heroku_formation" "web" {
      app_id = heroku_app.default.id
      type = "web"
      size = "basic"
      quantity = 1
    
      # Wait until the build has completed before attempting to scale
      depends_on = [heroku_build.default]
    }
    
    # Create the certificate
    resource "heroku_ssl" "one" {
      app_id = heroku_app.default.uuid
      certificate_chain = file("server.crt")
      private_key = file("server.key")
    
      # Wait until the process_tier changes to basic before attempting to create a cert
      depends_on = [heroku_formation.web]
    }
    
    resource "heroku_domain" "no-ssl" {
      app_id = heroku_app.default.id
      hostname = "terraform-123-no-ssl.example.com"
      # Until November 2021 if you have an ssl resource, but do not want to associate it with a domain, you must ensure the domain is created after the ssl resource. See https://devcenter.heroku.com/changelog-items/2192 for more details. We do this by adding a depends_on for the ssl resources.
      depends_on = [heroku_ssl.one]
    }
    
    # Associate it with a domain
    resource "heroku_domain" "one" {
      app_id = heroku_app.default.id
      hostname = "terraform-123.example.com"
      sni_endpoint_id = heroku_ssl.one.id
    }
    
    # Create another certificate
    resource "heroku_ssl" "two" {
      app_id = heroku_app.default.uuid
      certificate_chain = file("server.crt")
      private_key = file("server.key")
      # Wait until the process_tier changes to basic before attempting to create a cert
      depends_on = [heroku_formation.web]
    }
    
    # Associate it with a second domain
    resource "heroku_domain" "two" {
      app_id = heroku_app.default.id
      hostname = "terraform-456.example.com"
      sni_endpoint_id = heroku_ssl.two.id
    }
    

    Create Ssl Resource

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

    Constructor syntax

    new Ssl(name: string, args: SslArgs, opts?: CustomResourceOptions);
    @overload
    def Ssl(resource_name: str,
            args: SslArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Ssl(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            certificate_chain: Optional[str] = None,
            private_key: Optional[str] = None)
    func NewSsl(ctx *Context, name string, args SslArgs, opts ...ResourceOption) (*Ssl, error)
    public Ssl(string name, SslArgs args, CustomResourceOptions? opts = null)
    public Ssl(String name, SslArgs args)
    public Ssl(String name, SslArgs args, CustomResourceOptions options)
    
    type: heroku:ssl:Ssl
    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 SslArgs
    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 SslArgs
    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 SslArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SslArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SslArgs
    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 sslResource = new Heroku.Ssl.Ssl("sslResource", new()
    {
        AppId = "string",
        CertificateChain = "string",
        PrivateKey = "string",
    });
    
    example, err := ssl.NewSsl(ctx, "sslResource", &ssl.SslArgs{
    	AppId:            pulumi.String("string"),
    	CertificateChain: pulumi.String("string"),
    	PrivateKey:       pulumi.String("string"),
    })
    
    var sslResource = new Ssl("sslResource", SslArgs.builder()
        .appId("string")
        .certificateChain("string")
        .privateKey("string")
        .build());
    
    ssl_resource = heroku.ssl.Ssl("sslResource",
        app_id="string",
        certificate_chain="string",
        private_key="string")
    
    const sslResource = new heroku.ssl.Ssl("sslResource", {
        appId: "string",
        certificateChain: "string",
        privateKey: "string",
    });
    
    type: heroku:ssl:Ssl
    properties:
        appId: string
        certificateChain: string
        privateKey: string
    

    Ssl Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Ssl resource accepts the following input properties:

    AppId string
    Heroku app ID (do not use app name)
    CertificateChain string
    The certificate chain to add.
    PrivateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    AppId string
    Heroku app ID (do not use app name)
    CertificateChain string
    The certificate chain to add.
    PrivateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId String
    Heroku app ID (do not use app name)
    certificateChain String
    The certificate chain to add.
    privateKey String
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId string
    Heroku app ID (do not use app name)
    certificateChain string
    The certificate chain to add.
    privateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    app_id str
    Heroku app ID (do not use app name)
    certificate_chain str
    The certificate chain to add.
    private_key str
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId String
    Heroku app ID (do not use app name)
    certificateChain String
    The certificate chain to add.
    privateKey String
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the SSL certificate
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the SSL certificate
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the SSL certificate
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the SSL certificate
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the SSL certificate
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the SSL certificate

    Look up Existing Ssl Resource

    Get an existing Ssl 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?: SslState, opts?: CustomResourceOptions): Ssl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            certificate_chain: Optional[str] = None,
            name: Optional[str] = None,
            private_key: Optional[str] = None) -> Ssl
    func GetSsl(ctx *Context, name string, id IDInput, state *SslState, opts ...ResourceOption) (*Ssl, error)
    public static Ssl Get(string name, Input<string> id, SslState? state, CustomResourceOptions? opts = null)
    public static Ssl get(String name, Output<String> id, SslState state, CustomResourceOptions options)
    resources:  _:    type: heroku:ssl:Ssl    get:      id: ${id}
    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:
    AppId string
    Heroku app ID (do not use app name)
    CertificateChain string
    The certificate chain to add.
    Name string
    The name of the SSL certificate
    PrivateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    AppId string
    Heroku app ID (do not use app name)
    CertificateChain string
    The certificate chain to add.
    Name string
    The name of the SSL certificate
    PrivateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId String
    Heroku app ID (do not use app name)
    certificateChain String
    The certificate chain to add.
    name String
    The name of the SSL certificate
    privateKey String
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId string
    Heroku app ID (do not use app name)
    certificateChain string
    The certificate chain to add.
    name string
    The name of the SSL certificate
    privateKey string
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    app_id str
    Heroku app ID (do not use app name)
    certificate_chain str
    The certificate chain to add.
    name str
    The name of the SSL certificate
    private_key str
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.
    appId String
    Heroku app ID (do not use app name)
    certificateChain String
    The certificate chain to add.
    name String
    The name of the SSL certificate
    privateKey String
    The private key for a given certificate chain. You must set this attribute when creating or updating an SSL resource. However, do not set a value for this attribute if you are initially importing an existing SSL resource. The attribute value does not get displayed in logs or regular output.

    Import

    ing

    An existing SSL resource can be imported using a composite value of the app name and certificate UUID separated by a colon.

    For example:

    $ terraform import heroku_ssl.production_api production-api:b85d9224-310b-409b-891e-c903f5a40568
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    heroku pulumiverse/pulumi-heroku
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the heroku Terraform Provider.
    heroku logo
    Heroku v1.0.4 published on Tuesday, Apr 8, 2025 by pulumiverse - Marcel Arns