mailgun.ApiKey
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mailgun from "@pulumi/mailgun";
// Create a new Mailgun API key
const someKey = new mailgun.ApiKey("some_key", {
role: "basic",
kind: "user",
description: "Some key",
});
import pulumi
import pulumi_mailgun as mailgun
# Create a new Mailgun API key
some_key = mailgun.ApiKey("some_key",
role="basic",
kind="user",
description="Some key")
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 API key
_, err := mailgun.NewApiKey(ctx, "some_key", &mailgun.ApiKeyArgs{
Role: pulumi.String("basic"),
Kind: pulumi.String("user"),
Description: pulumi.String("Some key"),
})
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 API key
var someKey = new Mailgun.ApiKey("some_key", new()
{
Role = "basic",
Kind = "user",
Description = "Some key",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mailgun.ApiKey;
import com.pulumi.mailgun.ApiKeyArgs;
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 API key
var someKey = new ApiKey("someKey", ApiKeyArgs.builder()
.role("basic")
.kind("user")
.description("Some key")
.build());
}
}
resources:
# Create a new Mailgun API key
someKey:
type: mailgun:ApiKey
name: some_key
properties:
role: basic
kind: user
description: Some key
Create ApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);@overload
def ApiKey(resource_name: str,
args: ApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
role: Optional[str] = None,
description: Optional[str] = None,
domain_name: Optional[str] = None,
email: Optional[str] = None,
expires_at: Optional[int] = None,
kind: Optional[str] = None,
user_id: Optional[str] = None,
user_name: Optional[str] = None)func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: mailgun:ApiKey
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 ApiKeyArgs
- 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 ApiKeyArgs
- 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 ApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiKeyArgs
- 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 apiKeyResource = new Mailgun.ApiKey("apiKeyResource", new()
{
Role = "string",
Description = "string",
DomainName = "string",
Email = "string",
ExpiresAt = 0,
Kind = "string",
UserId = "string",
UserName = "string",
});
example, err := mailgun.NewApiKey(ctx, "apiKeyResource", &mailgun.ApiKeyArgs{
Role: pulumi.String("string"),
Description: pulumi.String("string"),
DomainName: pulumi.String("string"),
Email: pulumi.String("string"),
ExpiresAt: pulumi.Int(0),
Kind: pulumi.String("string"),
UserId: pulumi.String("string"),
UserName: pulumi.String("string"),
})
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
.role("string")
.description("string")
.domainName("string")
.email("string")
.expiresAt(0)
.kind("string")
.userId("string")
.userName("string")
.build());
api_key_resource = mailgun.ApiKey("apiKeyResource",
role="string",
description="string",
domain_name="string",
email="string",
expires_at=0,
kind="string",
user_id="string",
user_name="string")
const apiKeyResource = new mailgun.ApiKey("apiKeyResource", {
role: "string",
description: "string",
domainName: "string",
email: "string",
expiresAt: 0,
kind: "string",
userId: "string",
userName: "string",
});
type: mailgun:ApiKey
properties:
description: string
domainName: string
email: string
expiresAt: 0
kind: string
role: string
userId: string
userName: string
ApiKey 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 ApiKey resource accepts the following input properties:
- Role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - Description string
- Key description.
- Domain
Name string - Web domain to associate with the key, for keys of
domainkind. - Email string
- API key user's email address; should be provided for all keys of
webkind. - Expires
At int - When the key will expire.
- Kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - User
Id string - API key user's string user ID; should be provided for all keys of
webkind. - User
Name string - API key user's name.
- Role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - Description string
- Key description.
- Domain
Name string - Web domain to associate with the key, for keys of
domainkind. - Email string
- API key user's email address; should be provided for all keys of
webkind. - Expires
At int - When the key will expire.
- Kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - User
Id string - API key user's string user ID; should be provided for all keys of
webkind. - User
Name string - API key user's name.
- role String
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - description String
- Key description.
- domain
Name String - Web domain to associate with the key, for keys of
domainkind. - email String
- API key user's email address; should be provided for all keys of
webkind. - expires
At Integer - When the key will expire.
- kind String
- (Enum:
domain,user, orweb). API key type. Default:user. - user
Id String - API key user's string user ID; should be provided for all keys of
webkind. - user
Name String - API key user's name.
- role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - description string
- Key description.
- domain
Name string - Web domain to associate with the key, for keys of
domainkind. - email string
- API key user's email address; should be provided for all keys of
webkind. - expires
At number - When the key will expire.
- kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - user
Id string - API key user's string user ID; should be provided for all keys of
webkind. - user
Name string - API key user's name.
- role str
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - description str
- Key description.
- domain_
name str - Web domain to associate with the key, for keys of
domainkind. - email str
- API key user's email address; should be provided for all keys of
webkind. - expires_
at int - When the key will expire.
- kind str
- (Enum:
domain,user, orweb). API key type. Default:user. - user_
id str - API key user's string user ID; should be provided for all keys of
webkind. - user_
name str - API key user's name.
- role String
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - description String
- Key description.
- domain
Name String - Web domain to associate with the key, for keys of
domainkind. - email String
- API key user's email address; should be provided for all keys of
webkind. - expires
At Number - When the key will expire.
- kind String
- (Enum:
domain,user, orweb). API key type. Default:user. - user
Id String - API key user's string user ID; should be provided for all keys of
webkind. - user
Name String - API key user's name.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey resource produces the following output properties:
- Disabled
Reason string - The reason for the key's disablement.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Disabled bool - Whether or not the key is disabled from use.
- Requestor string
- An email address associated with the key.
- Secret string
- The full API key secret in plain text.
- Disabled
Reason string - The reason for the key's disablement.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Disabled bool - Whether or not the key is disabled from use.
- Requestor string
- An email address associated with the key.
- Secret string
- The full API key secret in plain text.
- disabled
Reason String - The reason for the key's disablement.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Disabled Boolean - Whether or not the key is disabled from use.
- requestor String
- An email address associated with the key.
- secret String
- The full API key secret in plain text.
- disabled
Reason string - The reason for the key's disablement.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Disabled boolean - Whether or not the key is disabled from use.
- requestor string
- An email address associated with the key.
- secret string
- The full API key secret in plain text.
- disabled_
reason str - The reason for the key's disablement.
- id str
- The provider-assigned unique ID for this managed resource.
- is_
disabled bool - Whether or not the key is disabled from use.
- requestor str
- An email address associated with the key.
- secret str
- The full API key secret in plain text.
- disabled
Reason String - The reason for the key's disablement.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Disabled Boolean - Whether or not the key is disabled from use.
- requestor String
- An email address associated with the key.
- secret String
- The full API key secret in plain text.
Look up Existing ApiKey Resource
Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
disabled_reason: Optional[str] = None,
domain_name: Optional[str] = None,
email: Optional[str] = None,
expires_at: Optional[int] = None,
is_disabled: Optional[bool] = None,
kind: Optional[str] = None,
requestor: Optional[str] = None,
role: Optional[str] = None,
secret: Optional[str] = None,
user_id: Optional[str] = None,
user_name: Optional[str] = None) -> ApiKeyfunc GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)resources: _: type: mailgun:ApiKey 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.
- Description string
- Key description.
- Disabled
Reason string - The reason for the key's disablement.
- Domain
Name string - Web domain to associate with the key, for keys of
domainkind. - Email string
- API key user's email address; should be provided for all keys of
webkind. - Expires
At int - When the key will expire.
- Is
Disabled bool - Whether or not the key is disabled from use.
- Kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - Requestor string
- An email address associated with the key.
- Role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - Secret string
- The full API key secret in plain text.
- User
Id string - API key user's string user ID; should be provided for all keys of
webkind. - User
Name string - API key user's name.
- Description string
- Key description.
- Disabled
Reason string - The reason for the key's disablement.
- Domain
Name string - Web domain to associate with the key, for keys of
domainkind. - Email string
- API key user's email address; should be provided for all keys of
webkind. - Expires
At int - When the key will expire.
- Is
Disabled bool - Whether or not the key is disabled from use.
- Kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - Requestor string
- An email address associated with the key.
- Role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - Secret string
- The full API key secret in plain text.
- User
Id string - API key user's string user ID; should be provided for all keys of
webkind. - User
Name string - API key user's name.
- description String
- Key description.
- disabled
Reason String - The reason for the key's disablement.
- domain
Name String - Web domain to associate with the key, for keys of
domainkind. - email String
- API key user's email address; should be provided for all keys of
webkind. - expires
At Integer - When the key will expire.
- is
Disabled Boolean - Whether or not the key is disabled from use.
- kind String
- (Enum:
domain,user, orweb). API key type. Default:user. - requestor String
- An email address associated with the key.
- role String
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - secret String
- The full API key secret in plain text.
- user
Id String - API key user's string user ID; should be provided for all keys of
webkind. - user
Name String - API key user's name.
- description string
- Key description.
- disabled
Reason string - The reason for the key's disablement.
- domain
Name string - Web domain to associate with the key, for keys of
domainkind. - email string
- API key user's email address; should be provided for all keys of
webkind. - expires
At number - When the key will expire.
- is
Disabled boolean - Whether or not the key is disabled from use.
- kind string
- (Enum:
domain,user, orweb). API key type. Default:user. - requestor string
- An email address associated with the key.
- role string
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - secret string
- The full API key secret in plain text.
- user
Id string - API key user's string user ID; should be provided for all keys of
webkind. - user
Name string - API key user's name.
- description str
- Key description.
- disabled_
reason str - The reason for the key's disablement.
- domain_
name str - Web domain to associate with the key, for keys of
domainkind. - email str
- API key user's email address; should be provided for all keys of
webkind. - expires_
at int - When the key will expire.
- is_
disabled bool - Whether or not the key is disabled from use.
- kind str
- (Enum:
domain,user, orweb). API key type. Default:user. - requestor str
- An email address associated with the key.
- role str
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - secret str
- The full API key secret in plain text.
- user_
id str - API key user's string user ID; should be provided for all keys of
webkind. - user_
name str - API key user's name.
- description String
- Key description.
- disabled
Reason String - The reason for the key's disablement.
- domain
Name String - Web domain to associate with the key, for keys of
domainkind. - email String
- API key user's email address; should be provided for all keys of
webkind. - expires
At Number - When the key will expire.
- is
Disabled Boolean - Whether or not the key is disabled from use.
- kind String
- (Enum:
domain,user, orweb). API key type. Default:user. - requestor String
- An email address associated with the key.
- role String
- (Enum:
admin,basic,sending,support, ordeveloper) Key role. - secret String
- The full API key secret in plain text.
- user
Id String - API key user's string user ID; should be provided for all keys of
webkind. - user
Name String - API key user's name.
Package Details
- Repository
- Mailgun pulumi/pulumi-mailgun
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mailgunTerraform Provider.
