netlify.EnvironmentVariable
Environment variables for Netlify sites. Read more
Create EnvironmentVariable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EnvironmentVariable(name: string, args: EnvironmentVariableArgs, opts?: CustomResourceOptions);@overload
def EnvironmentVariable(resource_name: str,
args: EnvironmentVariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EnvironmentVariable(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
secret_values: Optional[Sequence[EnvironmentVariableSecretValueArgs]] = None,
site_id: Optional[str] = None,
team_id: Optional[str] = None,
values: Optional[Sequence[EnvironmentVariableValueArgs]] = None)func NewEnvironmentVariable(ctx *Context, name string, args EnvironmentVariableArgs, opts ...ResourceOption) (*EnvironmentVariable, error)public EnvironmentVariable(string name, EnvironmentVariableArgs args, CustomResourceOptions? opts = null)
public EnvironmentVariable(String name, EnvironmentVariableArgs args)
public EnvironmentVariable(String name, EnvironmentVariableArgs args, CustomResourceOptions options)
type: netlify:EnvironmentVariable
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 EnvironmentVariableArgs
- 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 EnvironmentVariableArgs
- 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 EnvironmentVariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnvironmentVariableArgs
- 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 environmentVariableResource = new Netlify.EnvironmentVariable("environmentVariableResource", new()
{
Key = "string",
Scopes = new[]
{
"string",
},
SecretValues = new[]
{
new Netlify.Inputs.EnvironmentVariableSecretValueArgs
{
Context = "string",
Value = "string",
ContextParameter = "string",
},
},
SiteId = "string",
TeamId = "string",
Values = new[]
{
new Netlify.Inputs.EnvironmentVariableValueArgs
{
Context = "string",
Value = "string",
ContextParameter = "string",
},
},
});
example, err := netlify.NewEnvironmentVariable(ctx, "environmentVariableResource", &netlify.EnvironmentVariableArgs{
Key: pulumi.String("string"),
Scopes: pulumi.StringArray{
pulumi.String("string"),
},
SecretValues: netlify.EnvironmentVariableSecretValueArray{
&netlify.EnvironmentVariableSecretValueArgs{
Context: pulumi.String("string"),
Value: pulumi.String("string"),
ContextParameter: pulumi.String("string"),
},
},
SiteId: pulumi.String("string"),
TeamId: pulumi.String("string"),
Values: netlify.EnvironmentVariableValueArray{
&netlify.EnvironmentVariableValueArgs{
Context: pulumi.String("string"),
Value: pulumi.String("string"),
ContextParameter: pulumi.String("string"),
},
},
})
var environmentVariableResource = new EnvironmentVariable("environmentVariableResource", EnvironmentVariableArgs.builder()
.key("string")
.scopes("string")
.secretValues(EnvironmentVariableSecretValueArgs.builder()
.context("string")
.value("string")
.contextParameter("string")
.build())
.siteId("string")
.teamId("string")
.values(EnvironmentVariableValueArgs.builder()
.context("string")
.value("string")
.contextParameter("string")
.build())
.build());
environment_variable_resource = netlify.EnvironmentVariable("environmentVariableResource",
key="string",
scopes=["string"],
secret_values=[{
"context": "string",
"value": "string",
"context_parameter": "string",
}],
site_id="string",
team_id="string",
values=[{
"context": "string",
"value": "string",
"context_parameter": "string",
}])
const environmentVariableResource = new netlify.EnvironmentVariable("environmentVariableResource", {
key: "string",
scopes: ["string"],
secretValues: [{
context: "string",
value: "string",
contextParameter: "string",
}],
siteId: "string",
teamId: "string",
values: [{
context: "string",
value: "string",
contextParameter: "string",
}],
});
type: netlify:EnvironmentVariable
properties:
key: string
scopes:
- string
secretValues:
- context: string
contextParameter: string
value: string
siteId: string
teamId: string
values:
- context: string
contextParameter: string
value: string
EnvironmentVariable 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 EnvironmentVariable resource accepts the following input properties:
- Key string
- Scopes List<string>
- One or more of builds, functions, runtime, and post-processing.
- Secret
Values List<EnvironmentVariable Secret Value> - Site
Id string - Team
Id string - Required if a default team was not configured in the provider configuration.
- Values
List<Environment
Variable Value>
- Key string
- Scopes []string
- One or more of builds, functions, runtime, and post-processing.
- Secret
Values []EnvironmentVariable Secret Value Args - Site
Id string - Team
Id string - Required if a default team was not configured in the provider configuration.
- Values
[]Environment
Variable Value Args
- key String
- scopes List<String>
- One or more of builds, functions, runtime, and post-processing.
- secret
Values List<EnvironmentVariable Secret Value> - site
Id String - team
Id String - Required if a default team was not configured in the provider configuration.
- values
List<Environment
Variable Value>
- key string
- scopes string[]
- One or more of builds, functions, runtime, and post-processing.
- secret
Values EnvironmentVariable Secret Value[] - site
Id string - team
Id string - Required if a default team was not configured in the provider configuration.
- values
Environment
Variable Value[]
- key str
- scopes Sequence[str]
- One or more of builds, functions, runtime, and post-processing.
- secret_
values Sequence[EnvironmentVariable Secret Value Args] - site_
id str - team_
id str - Required if a default team was not configured in the provider configuration.
- values
Sequence[Environment
Variable Value Args]
- key String
- scopes List<String>
- One or more of builds, functions, runtime, and post-processing.
- secret
Values List<Property Map> - site
Id String - team
Id String - Required if a default team was not configured in the provider configuration.
- values List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the EnvironmentVariable resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated string
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated str
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
Look up Existing EnvironmentVariable Resource
Get an existing EnvironmentVariable 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?: EnvironmentVariableState, opts?: CustomResourceOptions): EnvironmentVariable@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
last_updated: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
secret_values: Optional[Sequence[EnvironmentVariableSecretValueArgs]] = None,
site_id: Optional[str] = None,
team_id: Optional[str] = None,
values: Optional[Sequence[EnvironmentVariableValueArgs]] = None) -> EnvironmentVariablefunc GetEnvironmentVariable(ctx *Context, name string, id IDInput, state *EnvironmentVariableState, opts ...ResourceOption) (*EnvironmentVariable, error)public static EnvironmentVariable Get(string name, Input<string> id, EnvironmentVariableState? state, CustomResourceOptions? opts = null)public static EnvironmentVariable get(String name, Output<String> id, EnvironmentVariableState state, CustomResourceOptions options)resources: _: type: netlify:EnvironmentVariable 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.
- Key string
- Last
Updated string - Scopes List<string>
- One or more of builds, functions, runtime, and post-processing.
- Secret
Values List<EnvironmentVariable Secret Value> - Site
Id string - Team
Id string - Required if a default team was not configured in the provider configuration.
- Values
List<Environment
Variable Value>
- Key string
- Last
Updated string - Scopes []string
- One or more of builds, functions, runtime, and post-processing.
- Secret
Values []EnvironmentVariable Secret Value Args - Site
Id string - Team
Id string - Required if a default team was not configured in the provider configuration.
- Values
[]Environment
Variable Value Args
- key String
- last
Updated String - scopes List<String>
- One or more of builds, functions, runtime, and post-processing.
- secret
Values List<EnvironmentVariable Secret Value> - site
Id String - team
Id String - Required if a default team was not configured in the provider configuration.
- values
List<Environment
Variable Value>
- key string
- last
Updated string - scopes string[]
- One or more of builds, functions, runtime, and post-processing.
- secret
Values EnvironmentVariable Secret Value[] - site
Id string - team
Id string - Required if a default team was not configured in the provider configuration.
- values
Environment
Variable Value[]
- key str
- last_
updated str - scopes Sequence[str]
- One or more of builds, functions, runtime, and post-processing.
- secret_
values Sequence[EnvironmentVariable Secret Value Args] - site_
id str - team_
id str - Required if a default team was not configured in the provider configuration.
- values
Sequence[Environment
Variable Value Args]
- key String
- last
Updated String - scopes List<String>
- One or more of builds, functions, runtime, and post-processing.
- secret
Values List<Property Map> - site
Id String - team
Id String - Required if a default team was not configured in the provider configuration.
- values List<Property Map>
Supporting Types
EnvironmentVariableSecretValue, EnvironmentVariableSecretValueArgs
- Context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- Value string
- Context
Parameter string
- Context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- Value string
- Context
Parameter string
- context String
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value String
- context
Parameter String
- context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value string
- context
Parameter string
- context str
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value str
- context_
parameter str
- context String
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value String
- context
Parameter String
EnvironmentVariableValue, EnvironmentVariableValueArgs
- Context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- Value string
- Context
Parameter string
- Context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- Value string
- Context
Parameter string
- context String
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value String
- context
Parameter String
- context string
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value string
- context
Parameter string
- context str
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value str
- context_
parameter str
- context String
- One of all, dev, branch-deploy, deploy-preview, production, or branch
- value String
- context
Parameter String
Import
Import a team-level environment variable using the team ID and the environment variable key
$ pulumi import netlify:index/environmentVariable:EnvironmentVariable name 6600abcdef1234567890abcd:ASTRO_DATABASE_FILE
Import a site-level environment variable using the team ID, the site ID, and the environment variable key
$ pulumi import netlify:index/environmentVariable:EnvironmentVariable name 6600abcdef1234567890abcd:12345667-0000-0000-0000-abcdef012345:ASTRO_DATABASE_FILE
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- netlify netlify/terraform-provider-netlify
- License
- Notes
- This Pulumi package is based on the
netlifyTerraform Provider.
