Relay class
Manages an AWS SES Mail Manager Relay.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.mailmanager.Relay("example", {
authentication: {
noAuthentication: {},
},
name: "example",
serverName: "smtp.example.com",
serverPort: 25,
});
import pulumi
import pulumi_aws as aws
example = aws.mailmanager.Relay("example",
authentication={
"no_authentication": {},
},
name="example",
server_name="smtp.example.com",
server_port=25)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.MailManager.Relay("example", new()
{
Authentication = new Aws.MailManager.Inputs.RelayAuthenticationArgs
{
NoAuthentication = null,
},
Name = "example",
ServerName = "smtp.example.com",
ServerPort = 25,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/mailmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mailmanager.NewRelay(ctx, "example", &mailmanager.RelayArgs{
Authentication: &mailmanager.RelayAuthenticationArgs{
NoAuthentication: &mailmanager.RelayAuthenticationNoAuthenticationArgs{},
},
Name: pulumi.String("example"),
ServerName: pulumi.String("smtp.example.com"),
ServerPort: pulumi.Int(25),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_mailmanager_relay" "example" {
authentication = {
no_authentication = {}
}
name = "example"
server_name = "smtp.example.com"
server_port = 25
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.mailmanager.Relay;
import com.pulumi.aws.mailmanager.RelayArgs;
import com.pulumi.aws.mailmanager.inputs.RelayAuthenticationArgs;
import com.pulumi.aws.mailmanager.inputs.RelayAuthenticationNoAuthenticationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Relay("example", RelayArgs.builder()
.authentication(RelayAuthenticationArgs.builder()
.noAuthentication(RelayAuthenticationNoAuthenticationArgs.builder()
.build())
.build())
.name("example")
.serverName("smtp.example.com")
.serverPort(25)
.build());
}
}
resources:
example:
type: aws:mailmanager:Relay
properties:
authentication:
noAuthentication: {}
name: example
serverName: smtp.example.com
serverPort: 25
With Secret Authentication
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.secretsmanager.Secret("example", {name: "example"});
const exampleSecretVersion = new aws.secretsmanager.SecretVersion("example", {
secretId: example.id,
secretString: JSON.stringify({
username: "user",
password: "pass",
}),
});
const exampleRelay = new aws.mailmanager.Relay("example", {
authentication: {
secretArn: exampleSecretVersion.arn,
},
name: "example",
serverName: "smtp.example.com",
serverPort: 587,
});
import pulumi
import json
import pulumi_aws as aws
example = aws.secretsmanager.Secret("example", name="example")
example_secret_version = aws.secretsmanager.SecretVersion("example",
secret_id=example.id,
secret_string=json.dumps({
"username": "user",
"password": "pass",
}))
example_relay = aws.mailmanager.Relay("example",
authentication={
"secret_arn": example_secret_version.arn,
},
name="example",
server_name="smtp.example.com",
server_port=587)
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.SecretsManager.Secret("example", new()
{
Name = "example",
});
var exampleSecretVersion = new Aws.SecretsManager.SecretVersion("example", new()
{
SecretId = example.Id,
SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["username"] = "user",
["password"] = "pass",
}),
});
var exampleRelay = new Aws.MailManager.Relay("example", new()
{
Authentication = new Aws.MailManager.Inputs.RelayAuthenticationArgs
{
SecretArn = exampleSecretVersion.Arn,
},
Name = "example",
ServerName = "smtp.example.com",
ServerPort = 587,
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/mailmanager"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := secretsmanager.NewSecret(ctx, "example", &secretsmanager.SecretArgs{
Name: pulumi.String("example"),
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]string{
"username": "user",
"password": "pass",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
exampleSecretVersion, err := secretsmanager.NewSecretVersion(ctx, "example", &secretsmanager.SecretVersionArgs{
SecretId: example.ID().ToIDOutput().ToStringOutput(),
SecretString: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = mailmanager.NewRelay(ctx, "example", &mailmanager.RelayArgs{
Authentication: &mailmanager.RelayAuthenticationArgs{
SecretArn: exampleSecretVersion.Arn,
},
Name: pulumi.String("example"),
ServerName: pulumi.String("smtp.example.com"),
ServerPort: pulumi.Int(587),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_secretsmanager_secret" "example" {
name = "example"
}
resource "aws_secretsmanager_secretversion" "example" {
secret_id = aws_secretsmanager_secret.example.id
secret_string = jsonencode({
"username" = "user"
"password" = "pass"
})
}
resource "aws_mailmanager_relay" "example" {
authentication = {
secret_arn = aws_secretsmanager_secretversion.example.arn
}
name = "example"
server_name = "smtp.example.com"
server_port = 587
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.Secret;
import com.pulumi.aws.secretsmanager.SecretArgs;
import com.pulumi.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.mailmanager.Relay;
import com.pulumi.aws.mailmanager.RelayArgs;
import com.pulumi.aws.mailmanager.inputs.RelayAuthenticationArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Secret("example", SecretArgs.builder()
.name("example")
.build());
var exampleSecretVersion = new SecretVersion("exampleSecretVersion", SecretVersionArgs.builder()
.secretId(example.id())
.secretString(serializeJson(
jsonObject(
jsonProperty("username", "user"),
jsonProperty("password", "pass")
)))
.build());
var exampleRelay = new Relay("exampleRelay", RelayArgs.builder()
.authentication(RelayAuthenticationArgs.builder()
.secretArn(exampleSecretVersion.arn())
.build())
.name("example")
.serverName("smtp.example.com")
.serverPort(587)
.build());
}
}
resources:
example:
type: aws:secretsmanager:Secret
properties:
name: example
exampleSecretVersion:
type: aws:secretsmanager:SecretVersion
name: example
properties:
secretId: ${example.id}
secretString:
fn::toJSON:
username: user
password: pass
exampleRelay:
type: aws:mailmanager:Relay
name: example
properties:
authentication:
secretArn: ${exampleSecretVersion.arn}
name: example
serverName: smtp.example.com
serverPort: 587
Import
Identity Schema
Required
id(String) Identifier of the relay.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import an SES Mail Manager Relay using its identifier. For example:
$ pulumi import aws:mailmanager/relay:Relay example relay-id-12345678
Constructors
- Relay(String name, {RelayArgs? args, CustomResourceOptions? options})
-
Creates a new Relay.
nameThe Pulumi resource name.argsArguments used to configure this Relay. The set of arguments for Relay.optionsResource options controlling this resource's behavior. - Relay.reference(String urn)
- Creates a typed reference to an existing Relay resource.
Properties
-
arn
↔ Output<
String> -
ARN of the relay.
latefinal
-
authentication
↔ Output<
RelayAuthentication?> -
Authentication configuration for the relay. See
authenticationBlock.latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createdTimestamp
↔ Output<
String> -
Timestamp when the relay was created.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
lastModifiedTimestamp
↔ Output<
String> -
Timestamp when the relay was last modified.
latefinal
-
name
↔ Output<
String> -
Name of the relay.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serverName
↔ Output<
String> -
Hostname of the SMTP server.
latefinal
-
serverPort
↔ Output<
int> -
Port of the SMTP server.
latefinal
-
Map of tags assigned to the resource. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited