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

heroku.addon.Addon

Explore with Pulumi AI

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

    Provides a Heroku Add-On resource. These can be attach services to a Heroku app.

    Example Usage

    # Create a new Heroku app
    resource "heroku_app" "default" {
      name = "test-app"
    }
    
    # Create a database, and configure the app to use it
    resource "heroku_addon" "database" {
      app_id = heroku_app.default.id
      plan   = "heroku-postgresql:standard-0"
    }
    

    Create Addon Resource

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

    Constructor syntax

    new Addon(name: string, args: AddonArgs, opts?: CustomResourceOptions);
    @overload
    def Addon(resource_name: str,
              args: AddonArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Addon(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              app_id: Optional[str] = None,
              plan: Optional[str] = None,
              config: Optional[Mapping[str, str]] = None,
              name: Optional[str] = None)
    func NewAddon(ctx *Context, name string, args AddonArgs, opts ...ResourceOption) (*Addon, error)
    public Addon(string name, AddonArgs args, CustomResourceOptions? opts = null)
    public Addon(String name, AddonArgs args)
    public Addon(String name, AddonArgs args, CustomResourceOptions options)
    
    type: heroku:addon:Addon
    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 AddonArgs
    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 AddonArgs
    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 AddonArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AddonArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AddonArgs
    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 addonResource = new Heroku.Addon.Addon("addonResource", new()
    {
        AppId = "string",
        Plan = "string",
        Config = 
        {
            { "string", "string" },
        },
        Name = "string",
    });
    
    example, err := addon.NewAddon(ctx, "addonResource", &addon.AddonArgs{
    	AppId: pulumi.String("string"),
    	Plan:  pulumi.String("string"),
    	Config: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var addonResource = new Addon("addonResource", AddonArgs.builder()
        .appId("string")
        .plan("string")
        .config(Map.of("string", "string"))
        .name("string")
        .build());
    
    addon_resource = heroku.addon.Addon("addonResource",
        app_id="string",
        plan="string",
        config={
            "string": "string",
        },
        name="string")
    
    const addonResource = new heroku.addon.Addon("addonResource", {
        appId: "string",
        plan: "string",
        config: {
            string: "string",
        },
        name: "string",
    });
    
    type: heroku:addon:Addon
    properties:
        appId: string
        config:
            string: string
        name: string
        plan: string
    

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

    AppId string
    Heroku app ID (do not use app name)
    Plan string
    The addon to add.
    Config Dictionary<string, string>
    Optional plan configuration.
    Name string
    Globally unique name of the add-on.
    AppId string
    Heroku app ID (do not use app name)
    Plan string
    The addon to add.
    Config map[string]string
    Optional plan configuration.
    Name string
    Globally unique name of the add-on.
    appId String
    Heroku app ID (do not use app name)
    plan String
    The addon to add.
    config Map<String,String>
    Optional plan configuration.
    name String
    Globally unique name of the add-on.
    appId string
    Heroku app ID (do not use app name)
    plan string
    The addon to add.
    config {[key: string]: string}
    Optional plan configuration.
    name string
    Globally unique name of the add-on.
    app_id str
    Heroku app ID (do not use app name)
    plan str
    The addon to add.
    config Mapping[str, str]
    Optional plan configuration.
    name str
    Globally unique name of the add-on.
    appId String
    Heroku app ID (do not use app name)
    plan String
    The addon to add.
    config Map<String>
    Optional plan configuration.
    name String
    Globally unique name of the add-on.

    Outputs

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

    ConfigVarValues Dictionary<string, string>
    ConfigVars List<string>
    The Configuration variables of the add-on
    Id string
    The provider-assigned unique ID for this managed resource.
    ProviderId string
    The ID of the plan provider
    ConfigVarValues map[string]string
    ConfigVars []string
    The Configuration variables of the add-on
    Id string
    The provider-assigned unique ID for this managed resource.
    ProviderId string
    The ID of the plan provider
    configVarValues Map<String,String>
    configVars List<String>
    The Configuration variables of the add-on
    id String
    The provider-assigned unique ID for this managed resource.
    providerId String
    The ID of the plan provider
    configVarValues {[key: string]: string}
    configVars string[]
    The Configuration variables of the add-on
    id string
    The provider-assigned unique ID for this managed resource.
    providerId string
    The ID of the plan provider
    config_var_values Mapping[str, str]
    config_vars Sequence[str]
    The Configuration variables of the add-on
    id str
    The provider-assigned unique ID for this managed resource.
    provider_id str
    The ID of the plan provider
    configVarValues Map<String>
    configVars List<String>
    The Configuration variables of the add-on
    id String
    The provider-assigned unique ID for this managed resource.
    providerId String
    The ID of the plan provider

    Look up Existing Addon Resource

    Get an existing Addon 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?: AddonState, opts?: CustomResourceOptions): Addon
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            app_id: Optional[str] = None,
            config: Optional[Mapping[str, str]] = None,
            config_var_values: Optional[Mapping[str, str]] = None,
            config_vars: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            plan: Optional[str] = None,
            provider_id: Optional[str] = None) -> Addon
    func GetAddon(ctx *Context, name string, id IDInput, state *AddonState, opts ...ResourceOption) (*Addon, error)
    public static Addon Get(string name, Input<string> id, AddonState? state, CustomResourceOptions? opts = null)
    public static Addon get(String name, Output<String> id, AddonState state, CustomResourceOptions options)
    resources:  _:    type: heroku:addon:Addon    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)
    Config Dictionary<string, string>
    Optional plan configuration.
    ConfigVarValues Dictionary<string, string>
    ConfigVars List<string>
    The Configuration variables of the add-on
    Name string
    Globally unique name of the add-on.
    Plan string
    The addon to add.
    ProviderId string
    The ID of the plan provider
    AppId string
    Heroku app ID (do not use app name)
    Config map[string]string
    Optional plan configuration.
    ConfigVarValues map[string]string
    ConfigVars []string
    The Configuration variables of the add-on
    Name string
    Globally unique name of the add-on.
    Plan string
    The addon to add.
    ProviderId string
    The ID of the plan provider
    appId String
    Heroku app ID (do not use app name)
    config Map<String,String>
    Optional plan configuration.
    configVarValues Map<String,String>
    configVars List<String>
    The Configuration variables of the add-on
    name String
    Globally unique name of the add-on.
    plan String
    The addon to add.
    providerId String
    The ID of the plan provider
    appId string
    Heroku app ID (do not use app name)
    config {[key: string]: string}
    Optional plan configuration.
    configVarValues {[key: string]: string}
    configVars string[]
    The Configuration variables of the add-on
    name string
    Globally unique name of the add-on.
    plan string
    The addon to add.
    providerId string
    The ID of the plan provider
    app_id str
    Heroku app ID (do not use app name)
    config Mapping[str, str]
    Optional plan configuration.
    config_var_values Mapping[str, str]
    config_vars Sequence[str]
    The Configuration variables of the add-on
    name str
    Globally unique name of the add-on.
    plan str
    The addon to add.
    provider_id str
    The ID of the plan provider
    appId String
    Heroku app ID (do not use app name)
    config Map<String>
    Optional plan configuration.
    configVarValues Map<String>
    configVars List<String>
    The Configuration variables of the add-on
    name String
    Globally unique name of the add-on.
    plan String
    The addon to add.
    providerId String
    The ID of the plan provider

    Import

    Addons can be imported using the Addon id, e.g.

    $ pulumi import heroku:addon/addon:Addon foobar 12345678
    

    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