mailgun.DomainCredential
Explore with Pulumi AI
Provides a Mailgun domain credential resource. This can be used to create and manage credential in domain of Mailgun.
Note: Please note that starting of v0.6.1 due to using new Mailgun Client API (v4), there is no possibility to retrieve previously created secrets via API. In order get it worked, it’s recommended to mark
password
as ignored underlifecycle
block. See below.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mailgun from "@pulumi/mailgun";
// Create a new Mailgun credential
const foobar = new mailgun.DomainCredential("foobar", {
domain: "toto.com",
login: "test",
password: "supersecretpassword1234",
region: "us",
});
import pulumi
import pulumi_mailgun as mailgun
# Create a new Mailgun credential
foobar = mailgun.DomainCredential("foobar",
domain="toto.com",
login="test",
password="supersecretpassword1234",
region="us")
package main
import (
"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a new Mailgun credential
_, err := mailgun.NewDomainCredential(ctx, "foobar", &mailgun.DomainCredentialArgs{
Domain: pulumi.String("toto.com"),
Login: pulumi.String("test"),
Password: pulumi.String("supersecretpassword1234"),
Region: pulumi.String("us"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mailgun = Pulumi.Mailgun;
return await Deployment.RunAsync(() =>
{
// Create a new Mailgun credential
var foobar = new Mailgun.DomainCredential("foobar", new()
{
Domain = "toto.com",
Login = "test",
Password = "supersecretpassword1234",
Region = "us",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mailgun.DomainCredential;
import com.pulumi.mailgun.DomainCredentialArgs;
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) {
// Create a new Mailgun credential
var foobar = new DomainCredential("foobar", DomainCredentialArgs.builder()
.domain("toto.com")
.login("test")
.password("supersecretpassword1234")
.region("us")
.build());
}
}
resources:
# Create a new Mailgun credential
foobar:
type: mailgun:DomainCredential
properties:
domain: toto.com
login: test
password: supersecretpassword1234
region: us
Create DomainCredential Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DomainCredential(name: string, args: DomainCredentialArgs, opts?: CustomResourceOptions);
@overload
def DomainCredential(resource_name: str,
args: DomainCredentialArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DomainCredential(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
login: Optional[str] = None,
password: Optional[str] = None,
region: Optional[str] = None)
func NewDomainCredential(ctx *Context, name string, args DomainCredentialArgs, opts ...ResourceOption) (*DomainCredential, error)
public DomainCredential(string name, DomainCredentialArgs args, CustomResourceOptions? opts = null)
public DomainCredential(String name, DomainCredentialArgs args)
public DomainCredential(String name, DomainCredentialArgs args, CustomResourceOptions options)
type: mailgun:DomainCredential
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 DomainCredentialArgs
- 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 DomainCredentialArgs
- 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 DomainCredentialArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainCredentialArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DomainCredentialArgs
- 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 domainCredentialResource = new Mailgun.DomainCredential("domainCredentialResource", new()
{
Domain = "string",
Login = "string",
Password = "string",
Region = "string",
});
example, err := mailgun.NewDomainCredential(ctx, "domainCredentialResource", &mailgun.DomainCredentialArgs{
Domain: pulumi.String("string"),
Login: pulumi.String("string"),
Password: pulumi.String("string"),
Region: pulumi.String("string"),
})
var domainCredentialResource = new DomainCredential("domainCredentialResource", DomainCredentialArgs.builder()
.domain("string")
.login("string")
.password("string")
.region("string")
.build());
domain_credential_resource = mailgun.DomainCredential("domainCredentialResource",
domain="string",
login="string",
password="string",
region="string")
const domainCredentialResource = new mailgun.DomainCredential("domainCredentialResource", {
domain: "string",
login: "string",
password: "string",
region: "string",
});
type: mailgun:DomainCredential
properties:
domain: string
login: string
password: string
region: string
DomainCredential 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 DomainCredential resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the DomainCredential 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 DomainCredential Resource
Get an existing DomainCredential 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?: DomainCredentialState, opts?: CustomResourceOptions): DomainCredential
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
login: Optional[str] = None,
password: Optional[str] = None,
region: Optional[str] = None) -> DomainCredential
func GetDomainCredential(ctx *Context, name string, id IDInput, state *DomainCredentialState, opts ...ResourceOption) (*DomainCredential, error)
public static DomainCredential Get(string name, Input<string> id, DomainCredentialState? state, CustomResourceOptions? opts = null)
public static DomainCredential get(String name, Output<String> id, DomainCredentialState 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.
Import
Domain credential can be imported using region:email
via import
command. Region has to be chosen from eu
or us
(when no selection us
is applied).
Password is always exported to null
.
hcl
$ pulumi import mailgun:index/domainCredential:DomainCredential test us:test@domain.com
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Mailgun pulumi/pulumi-mailgun
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mailgun
Terraform Provider.