azure.automation.Credential
Explore with Pulumi AI
Manages a Automation Credential.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleAccount = new Azure.Automation.Account("exampleAccount", new()
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
SkuName = "Basic",
});
var exampleCredential = new Azure.Automation.Credential("exampleCredential", new()
{
ResourceGroupName = exampleResourceGroup.Name,
AutomationAccountName = exampleAccount.Name,
Username = "example_user",
Password = "example_pwd",
Description = "This is an example credential",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
SkuName: pulumi.String("Basic"),
})
if err != nil {
return err
}
_, err = automation.NewCredential(ctx, "exampleCredential", &automation.CredentialArgs{
ResourceGroupName: exampleResourceGroup.Name,
AutomationAccountName: exampleAccount.Name,
Username: pulumi.String("example_user"),
Password: pulumi.String("example_pwd"),
Description: pulumi.String("This is an example credential"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.Credential;
import com.pulumi.azure.automation.CredentialArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("Basic")
.build());
var exampleCredential = new Credential("exampleCredential", CredentialArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.automationAccountName(exampleAccount.name())
.username("example_user")
.password("example_pwd")
.description("This is an example credential")
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_account = azure.automation.Account("exampleAccount",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku_name="Basic")
example_credential = azure.automation.Credential("exampleCredential",
resource_group_name=example_resource_group.name,
automation_account_name=example_account.name,
username="example_user",
password="example_pwd",
description="This is an example credential")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAccount = new azure.automation.Account("exampleAccount", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
skuName: "Basic",
});
const exampleCredential = new azure.automation.Credential("exampleCredential", {
resourceGroupName: exampleResourceGroup.name,
automationAccountName: exampleAccount.name,
username: "example_user",
password: "example_pwd",
description: "This is an example credential",
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleAccount:
type: azure:automation:Account
properties:
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
skuName: Basic
exampleCredential:
type: azure:automation:Credential
properties:
resourceGroupName: ${exampleResourceGroup.name}
automationAccountName: ${exampleAccount.name}
username: example_user
password: example_pwd
description: This is an example credential
Create Credential Resource
new Credential(name: string, args: CredentialArgs, opts?: CustomResourceOptions);
@overload
def Credential(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None,
resource_group_name: Optional[str] = None,
username: Optional[str] = None)
@overload
def Credential(resource_name: str,
args: CredentialArgs,
opts: Optional[ResourceOptions] = None)
func NewCredential(ctx *Context, name string, args CredentialArgs, opts ...ResourceOption) (*Credential, error)
public Credential(string name, CredentialArgs args, CustomResourceOptions? opts = null)
public Credential(String name, CredentialArgs args)
public Credential(String name, CredentialArgs args, CustomResourceOptions options)
type: azure:automation:Credential
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CredentialArgs
- 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 CredentialArgs
- 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 CredentialArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CredentialArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CredentialArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Credential 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 Credential resource accepts the following input properties:
- Automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- Password string
The password associated with this Automation Credential.
- Resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- Username string
The username associated with this Automation Credential.
- Description string
The description associated with this Automation Credential.
- Name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- Automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- Password string
The password associated with this Automation Credential.
- Resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- Username string
The username associated with this Automation Credential.
- Description string
The description associated with this Automation Credential.
- Name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- automation
Account StringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- password String
The password associated with this Automation Credential.
- resource
Group StringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username String
The username associated with this Automation Credential.
- description String
The description associated with this Automation Credential.
- name String
Specifies the name of the Credential. Changing this forces a new resource to be created.
- automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- password string
The password associated with this Automation Credential.
- resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username string
The username associated with this Automation Credential.
- description string
The description associated with this Automation Credential.
- name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- automation_
account_ strname The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- password str
The password associated with this Automation Credential.
- resource_
group_ strname The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username str
The username associated with this Automation Credential.
- description str
The description associated with this Automation Credential.
- name str
Specifies the name of the Credential. Changing this forces a new resource to be created.
- automation
Account StringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- password String
The password associated with this Automation Credential.
- resource
Group StringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username String
The username associated with this Automation Credential.
- description String
The description associated with this Automation Credential.
- name String
Specifies the name of the Credential. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Credential resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Credential Resource
Get an existing Credential 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?: CredentialState, opts?: CustomResourceOptions): Credential
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None,
resource_group_name: Optional[str] = None,
username: Optional[str] = None) -> Credential
func GetCredential(ctx *Context, name string, id IDInput, state *CredentialState, opts ...ResourceOption) (*Credential, error)
public static Credential Get(string name, Input<string> id, CredentialState? state, CustomResourceOptions? opts = null)
public static Credential get(String name, Output<String> id, CredentialState 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.
- Automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- Description string
The description associated with this Automation Credential.
- Name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- Password string
The password associated with this Automation Credential.
- Resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- Username string
The username associated with this Automation Credential.
- Automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- Description string
The description associated with this Automation Credential.
- Name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- Password string
The password associated with this Automation Credential.
- Resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- Username string
The username associated with this Automation Credential.
- automation
Account StringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- description String
The description associated with this Automation Credential.
- name String
Specifies the name of the Credential. Changing this forces a new resource to be created.
- password String
The password associated with this Automation Credential.
- resource
Group StringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username String
The username associated with this Automation Credential.
- automation
Account stringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- description string
The description associated with this Automation Credential.
- name string
Specifies the name of the Credential. Changing this forces a new resource to be created.
- password string
The password associated with this Automation Credential.
- resource
Group stringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username string
The username associated with this Automation Credential.
- automation_
account_ strname The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- description str
The description associated with this Automation Credential.
- name str
Specifies the name of the Credential. Changing this forces a new resource to be created.
- password str
The password associated with this Automation Credential.
- resource_
group_ strname The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username str
The username associated with this Automation Credential.
- automation
Account StringName The name of the automation account in which the Credential is created. Changing this forces a new resource to be created.
- description String
The description associated with this Automation Credential.
- name String
Specifies the name of the Credential. Changing this forces a new resource to be created.
- password String
The password associated with this Automation Credential.
- resource
Group StringName The name of the resource group in which the Credential is created. Changing this forces a new resource to be created.
- username String
The username associated with this Automation Credential.
Import
Automation Credentials can be imported using the resource id
, e.g.
$ pulumi import azure:automation/credential:Credential credential1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/credentials/credential1
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.