aws.notifications.ChannelAssociation
Explore with Pulumi AI
Resource for managing an AWS User Notifications Channel Association. This resource associates a channel (such as an email contact) with a notification configuration.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.notifications.NotificationConfiguration("example", {
name: "example-notification-config",
description: "Example notification configuration",
});
const exampleContactsEmailContact = new aws.notifications.ContactsEmailContact("example", {
name: "example-contact",
emailAddress: "example@example.com",
});
const exampleChannelAssociation = new aws.notifications.ChannelAssociation("example", {
arn: exampleContactsEmailContact.arn,
notificationConfigurationArn: example.arn,
});
import pulumi
import pulumi_aws as aws
example = aws.notifications.NotificationConfiguration("example",
name="example-notification-config",
description="Example notification configuration")
example_contacts_email_contact = aws.notifications.ContactsEmailContact("example",
name="example-contact",
email_address="example@example.com")
example_channel_association = aws.notifications.ChannelAssociation("example",
arn=example_contacts_email_contact.arn,
notification_configuration_arn=example.arn)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/notifications"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := notifications.NewNotificationConfiguration(ctx, "example", ¬ifications.NotificationConfigurationArgs{
Name: pulumi.String("example-notification-config"),
Description: pulumi.String("Example notification configuration"),
})
if err != nil {
return err
}
exampleContactsEmailContact, err := notifications.NewContactsEmailContact(ctx, "example", ¬ifications.ContactsEmailContactArgs{
Name: pulumi.String("example-contact"),
EmailAddress: pulumi.String("example@example.com"),
})
if err != nil {
return err
}
_, err = notifications.NewChannelAssociation(ctx, "example", ¬ifications.ChannelAssociationArgs{
Arn: exampleContactsEmailContact.Arn,
NotificationConfigurationArn: example.Arn,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Notifications.NotificationConfiguration("example", new()
{
Name = "example-notification-config",
Description = "Example notification configuration",
});
var exampleContactsEmailContact = new Aws.Notifications.ContactsEmailContact("example", new()
{
Name = "example-contact",
EmailAddress = "example@example.com",
});
var exampleChannelAssociation = new Aws.Notifications.ChannelAssociation("example", new()
{
Arn = exampleContactsEmailContact.Arn,
NotificationConfigurationArn = example.Arn,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.notifications.NotificationConfiguration;
import com.pulumi.aws.notifications.NotificationConfigurationArgs;
import com.pulumi.aws.notifications.ContactsEmailContact;
import com.pulumi.aws.notifications.ContactsEmailContactArgs;
import com.pulumi.aws.notifications.ChannelAssociation;
import com.pulumi.aws.notifications.ChannelAssociationArgs;
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 example = new NotificationConfiguration("example", NotificationConfigurationArgs.builder()
.name("example-notification-config")
.description("Example notification configuration")
.build());
var exampleContactsEmailContact = new ContactsEmailContact("exampleContactsEmailContact", ContactsEmailContactArgs.builder()
.name("example-contact")
.emailAddress("example@example.com")
.build());
var exampleChannelAssociation = new ChannelAssociation("exampleChannelAssociation", ChannelAssociationArgs.builder()
.arn(exampleContactsEmailContact.arn())
.notificationConfigurationArn(example.arn())
.build());
}
}
resources:
example:
type: aws:notifications:NotificationConfiguration
properties:
name: example-notification-config
description: Example notification configuration
exampleContactsEmailContact:
type: aws:notifications:ContactsEmailContact
name: example
properties:
name: example-contact
emailAddress: example@example.com
exampleChannelAssociation:
type: aws:notifications:ChannelAssociation
name: example
properties:
arn: ${exampleContactsEmailContact.arn}
notificationConfigurationArn: ${example.arn}
Create ChannelAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ChannelAssociation(name: string, args: ChannelAssociationArgs, opts?: CustomResourceOptions);
@overload
def ChannelAssociation(resource_name: str,
args: ChannelAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ChannelAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
notification_configuration_arn: Optional[str] = None)
func NewChannelAssociation(ctx *Context, name string, args ChannelAssociationArgs, opts ...ResourceOption) (*ChannelAssociation, error)
public ChannelAssociation(string name, ChannelAssociationArgs args, CustomResourceOptions? opts = null)
public ChannelAssociation(String name, ChannelAssociationArgs args)
public ChannelAssociation(String name, ChannelAssociationArgs args, CustomResourceOptions options)
type: aws:notifications:ChannelAssociation
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 ChannelAssociationArgs
- 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 ChannelAssociationArgs
- 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 ChannelAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ChannelAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ChannelAssociationArgs
- 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 channelAssociationResource = new Aws.Notifications.ChannelAssociation("channelAssociationResource", new()
{
Arn = "string",
NotificationConfigurationArn = "string",
});
example, err := notifications.NewChannelAssociation(ctx, "channelAssociationResource", ¬ifications.ChannelAssociationArgs{
Arn: pulumi.String("string"),
NotificationConfigurationArn: pulumi.String("string"),
})
var channelAssociationResource = new ChannelAssociation("channelAssociationResource", ChannelAssociationArgs.builder()
.arn("string")
.notificationConfigurationArn("string")
.build());
channel_association_resource = aws.notifications.ChannelAssociation("channelAssociationResource",
arn="string",
notification_configuration_arn="string")
const channelAssociationResource = new aws.notifications.ChannelAssociation("channelAssociationResource", {
arn: "string",
notificationConfigurationArn: "string",
});
type: aws:notifications:ChannelAssociation
properties:
arn: string
notificationConfigurationArn: string
ChannelAssociation 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 ChannelAssociation resource accepts the following input properties:
- Arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- Notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- Arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- Notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- arn String
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration StringArn - ARN of the notification configuration to associate the channel with.
- arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- arn str
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification_
configuration_ strarn - ARN of the notification configuration to associate the channel with.
- arn String
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration StringArn - ARN of the notification configuration to associate the channel with.
Outputs
All input properties are implicitly available as output properties. Additionally, the ChannelAssociation 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 ChannelAssociation Resource
Get an existing ChannelAssociation 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?: ChannelAssociationState, opts?: CustomResourceOptions): ChannelAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
notification_configuration_arn: Optional[str] = None) -> ChannelAssociation
func GetChannelAssociation(ctx *Context, name string, id IDInput, state *ChannelAssociationState, opts ...ResourceOption) (*ChannelAssociation, error)
public static ChannelAssociation Get(string name, Input<string> id, ChannelAssociationState? state, CustomResourceOptions? opts = null)
public static ChannelAssociation get(String name, Output<String> id, ChannelAssociationState state, CustomResourceOptions options)
resources: _: type: aws:notifications:ChannelAssociation 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.
- Arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- Notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- Arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- Notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- arn String
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration StringArn - ARN of the notification configuration to associate the channel with.
- arn string
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration stringArn - ARN of the notification configuration to associate the channel with.
- arn str
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification_
configuration_ strarn - ARN of the notification configuration to associate the channel with.
- arn String
- ARN of the channel to associate with the notification configuration. This can be an email contact ARN.
- notification
Configuration StringArn - ARN of the notification configuration to associate the channel with.
Import
Using pulumi import
, import User Notifications Channel Association using the notification_configuration_arn,channel_arn
format. For example:
$ pulumi import aws:notifications/channelAssociation:ChannelAssociation example arn:aws:notifications:us-west-2:123456789012:configuration:example-notification-config,arn:aws:notificationscontacts:us-west-2:123456789012:emailcontact:example-contact
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.