heroku.pipeline.ConfigVar
Explore with Pulumi AI
Provides a resource to manage a pipeline’s config vars.
The pipeline config var API can only retrieve config vars that can be set at the pipeline level. Additionally, these two supported pipeline stages are:
- Heroku CI config vars (test stage)
- Review Apps config vars (review stage)
The development, staging & production stages do not have stage-level config vars, only those on the apps within each stage.
Example Usage
# Create a Heroku pipeline
resource "heroku_pipeline" "test-pipeline" {
name = "test-app"
}
resource "heroku_pipeline_config_var" "configs" {
pipeline_id = heroku_pipeline.test-pipeline.id
pipeline_stage = "test"
vars = {
ENV = "test"
TARGET = "develop"
}
sensitive_vars = {
TEST_ACCESS_TOKEN = "some_access token"
}
}
Create ConfigVar Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ConfigVar(name: string, args: ConfigVarArgs, opts?: CustomResourceOptions);
@overload
def ConfigVar(resource_name: str,
args: ConfigVarArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ConfigVar(resource_name: str,
opts: Optional[ResourceOptions] = None,
pipeline_id: Optional[str] = None,
pipeline_stage: Optional[str] = None,
sensitive_vars: Optional[Mapping[str, str]] = None,
vars: Optional[Mapping[str, str]] = None)
func NewConfigVar(ctx *Context, name string, args ConfigVarArgs, opts ...ResourceOption) (*ConfigVar, error)
public ConfigVar(string name, ConfigVarArgs args, CustomResourceOptions? opts = null)
public ConfigVar(String name, ConfigVarArgs args)
public ConfigVar(String name, ConfigVarArgs args, CustomResourceOptions options)
type: heroku:pipeline:ConfigVar
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 ConfigVarArgs
- 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 ConfigVarArgs
- 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 ConfigVarArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConfigVarArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ConfigVarArgs
- 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 configVarResource = new Heroku.Pipeline.ConfigVar("configVarResource", new()
{
PipelineId = "string",
PipelineStage = "string",
SensitiveVars =
{
{ "string", "string" },
},
Vars =
{
{ "string", "string" },
},
});
example, err := pipeline.NewConfigVar(ctx, "configVarResource", &pipeline.ConfigVarArgs{
PipelineId: pulumi.String("string"),
PipelineStage: pulumi.String("string"),
SensitiveVars: pulumi.StringMap{
"string": pulumi.String("string"),
},
Vars: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var configVarResource = new ConfigVar("configVarResource", ConfigVarArgs.builder()
.pipelineId("string")
.pipelineStage("string")
.sensitiveVars(Map.of("string", "string"))
.vars(Map.of("string", "string"))
.build());
config_var_resource = heroku.pipeline.ConfigVar("configVarResource",
pipeline_id="string",
pipeline_stage="string",
sensitive_vars={
"string": "string",
},
vars={
"string": "string",
})
const configVarResource = new heroku.pipeline.ConfigVar("configVarResource", {
pipelineId: "string",
pipelineStage: "string",
sensitiveVars: {
string: "string",
},
vars: {
string: "string",
},
});
type: heroku:pipeline:ConfigVar
properties:
pipelineId: string
pipelineStage: string
sensitiveVars:
string: string
vars:
string: string
ConfigVar 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 ConfigVar resource accepts the following input properties:
- Pipeline
Id string - The UUID of an existing pipeline.
- Pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - Sensitive
Vars Dictionary<string, string> - Vars Dictionary<string, string>
- Map of config vars that can be output in plaintext.
- Pipeline
Id string - The UUID of an existing pipeline.
- Pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - Sensitive
Vars map[string]string - Vars map[string]string
- Map of config vars that can be output in plaintext.
- pipeline
Id String - The UUID of an existing pipeline.
- pipeline
Stage String - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars Map<String,String> - vars Map<String,String>
- Map of config vars that can be output in plaintext.
- pipeline
Id string - The UUID of an existing pipeline.
- pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars {[key: string]: string} - vars {[key: string]: string}
- Map of config vars that can be output in plaintext.
- pipeline_
id str - The UUID of an existing pipeline.
- pipeline_
stage str - The pipeline's stage. Supported values are
test
&review
. - sensitive_
vars Mapping[str, str] - vars Mapping[str, str]
- Map of config vars that can be output in plaintext.
- pipeline
Id String - The UUID of an existing pipeline.
- pipeline
Stage String - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars Map<String> - vars Map<String>
- Map of config vars that can be output in plaintext.
Outputs
All input properties are implicitly available as output properties. Additionally, the ConfigVar resource produces the following output properties:
Look up Existing ConfigVar Resource
Get an existing ConfigVar 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?: ConfigVarState, opts?: CustomResourceOptions): ConfigVar
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
all_vars: Optional[Mapping[str, str]] = None,
pipeline_id: Optional[str] = None,
pipeline_stage: Optional[str] = None,
sensitive_vars: Optional[Mapping[str, str]] = None,
vars: Optional[Mapping[str, str]] = None) -> ConfigVar
func GetConfigVar(ctx *Context, name string, id IDInput, state *ConfigVarState, opts ...ResourceOption) (*ConfigVar, error)
public static ConfigVar Get(string name, Input<string> id, ConfigVarState? state, CustomResourceOptions? opts = null)
public static ConfigVar get(String name, Output<String> id, ConfigVarState state, CustomResourceOptions options)
resources: _: type: heroku:pipeline:ConfigVar 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.
- All
Vars Dictionary<string, string> - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - Pipeline
Id string - The UUID of an existing pipeline.
- Pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - Sensitive
Vars Dictionary<string, string> - Vars Dictionary<string, string>
- Map of config vars that can be output in plaintext.
- All
Vars map[string]string - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - Pipeline
Id string - The UUID of an existing pipeline.
- Pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - Sensitive
Vars map[string]string - Vars map[string]string
- Map of config vars that can be output in plaintext.
- all
Vars Map<String,String> - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - pipeline
Id String - The UUID of an existing pipeline.
- pipeline
Stage String - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars Map<String,String> - vars Map<String,String>
- Map of config vars that can be output in plaintext.
- all
Vars {[key: string]: string} - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - pipeline
Id string - The UUID of an existing pipeline.
- pipeline
Stage string - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars {[key: string]: string} - vars {[key: string]: string}
- Map of config vars that can be output in plaintext.
- all_
vars Mapping[str, str] - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - pipeline_
id str - The UUID of an existing pipeline.
- pipeline_
stage str - The pipeline's stage. Supported values are
test
&review
. - sensitive_
vars Mapping[str, str] - vars Mapping[str, str]
- Map of config vars that can be output in plaintext.
- all
Vars Map<String> - All vars of a pipeline stage. This is marked
sensitive
so thatsensitive_vars
do not leak in the console/logs. - pipeline
Id String - The UUID of an existing pipeline.
- pipeline
Stage String - The pipeline's stage. Supported values are
test
&review
. - sensitive
Vars Map<String> - vars Map<String>
- Map of config vars that can be output in plaintext.
Import
This resource defines two config var attributes with one of them used for masking any sensitive/secret variables
during a pulumi preview|apply
in a CI build, terminal, etc. This ‘sensitive’ distinction for config vars is unique to
this provider and not a built-in feature of the Heroku Platform API. Therefore, it will not be possible to import
this resource.
However, it is safe to define the resource in your configuration file and execute a pulumi up
as the end result is noop
when the config vars already exist on the remote resource.
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.