com.pulumi.aws.oam.kotlin.LinkArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.oam.kotlin
import com.pulumi.aws.oam.LinkArgs.builder
import com.pulumi.aws.oam.kotlin.inputs.LinkLinkConfigurationArgs
import com.pulumi.aws.oam.kotlin.inputs.LinkLinkConfigurationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Resource for managing an AWS CloudWatch Observability Access Manager Link.
* ## Example Usage
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.oam.Link("example", {
* labelTemplate: "$AccountName",
* resourceTypes: ["AWS::CloudWatch::Metric"],
* sinkIdentifier: test.id,
* tags: {
* Env: "prod",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.oam.Link("example",
* label_template="$AccountName",
* resource_types=["AWS::CloudWatch::Metric"],
* sink_identifier=test["id"],
* tags={
* "Env": "prod",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Oam.Link("example", new()
* {
* LabelTemplate = "$AccountName",
* ResourceTypes = new[]
* {
* "AWS::CloudWatch::Metric",
* },
* SinkIdentifier = test.Id,
* Tags =
* {
* { "Env", "prod" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/oam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := oam.NewLink(ctx, "example", &oam.LinkArgs{
* LabelTemplate: pulumi.String("$AccountName"),
* ResourceTypes: pulumi.StringArray{
* pulumi.String("AWS::CloudWatch::Metric"),
* },
* SinkIdentifier: pulumi.Any(test.Id),
* Tags: pulumi.StringMap{
* "Env": pulumi.String("prod"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.oam.Link;
* import com.pulumi.aws.oam.LinkArgs;
* 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 Link("example", LinkArgs.builder()
* .labelTemplate("$AccountName")
* .resourceTypes("AWS::CloudWatch::Metric")
* .sinkIdentifier(test.id())
* .tags(Map.of("Env", "prod"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:oam:Link
* properties:
* labelTemplate: $AccountName
* resourceTypes:
* - AWS::CloudWatch::Metric
* sinkIdentifier: ${test.id}
* tags:
* Env: prod
* ```
*
* ### Log Group Filtering
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.oam.Link("example", {
* labelTemplate: "$AccountName",
* linkConfiguration: {
* logGroupConfiguration: {
* filter: "LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'",
* },
* },
* resourceTypes: ["AWS::Logs::LogGroup"],
* sinkIdentifier: test.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.oam.Link("example",
* label_template="$AccountName",
* link_configuration={
* "log_group_configuration": {
* "filter": "LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'",
* },
* },
* resource_types=["AWS::Logs::LogGroup"],
* sink_identifier=test["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Oam.Link("example", new()
* {
* LabelTemplate = "$AccountName",
* LinkConfiguration = new Aws.Oam.Inputs.LinkLinkConfigurationArgs
* {
* LogGroupConfiguration = new Aws.Oam.Inputs.LinkLinkConfigurationLogGroupConfigurationArgs
* {
* Filter = "LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'",
* },
* },
* ResourceTypes = new[]
* {
* "AWS::Logs::LogGroup",
* },
* SinkIdentifier = test.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/oam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := oam.NewLink(ctx, "example", &oam.LinkArgs{
* LabelTemplate: pulumi.String("$AccountName"),
* LinkConfiguration: &oam.LinkLinkConfigurationArgs{
* LogGroupConfiguration: &oam.LinkLinkConfigurationLogGroupConfigurationArgs{
* Filter: pulumi.String("LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'"),
* },
* },
* ResourceTypes: pulumi.StringArray{
* pulumi.String("AWS::Logs::LogGroup"),
* },
* SinkIdentifier: pulumi.Any(test.Id),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.oam.Link;
* import com.pulumi.aws.oam.LinkArgs;
* import com.pulumi.aws.oam.inputs.LinkLinkConfigurationArgs;
* import com.pulumi.aws.oam.inputs.LinkLinkConfigurationLogGroupConfigurationArgs;
* 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 Link("example", LinkArgs.builder()
* .labelTemplate("$AccountName")
* .linkConfiguration(LinkLinkConfigurationArgs.builder()
* .logGroupConfiguration(LinkLinkConfigurationLogGroupConfigurationArgs.builder()
* .filter("LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'")
* .build())
* .build())
* .resourceTypes("AWS::Logs::LogGroup")
* .sinkIdentifier(test.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:oam:Link
* properties:
* labelTemplate: $AccountName
* linkConfiguration:
* logGroupConfiguration:
* filter: LogGroupName LIKE 'aws/lambda/%' OR LogGroupName LIKE 'AWSLogs%'
* resourceTypes:
* - AWS::Logs::LogGroup
* sinkIdentifier: ${test.id}
* ```
*
* ### Metric Filtering
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.oam.Link("example", {
* labelTemplate: "$AccountName",
* linkConfiguration: {
* metricConfiguration: {
* filter: "Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')",
* },
* },
* resourceTypes: ["AWS::CloudWatch::Metric"],
* sinkIdentifier: test.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.oam.Link("example",
* label_template="$AccountName",
* link_configuration={
* "metric_configuration": {
* "filter": "Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')",
* },
* },
* resource_types=["AWS::CloudWatch::Metric"],
* sink_identifier=test["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Oam.Link("example", new()
* {
* LabelTemplate = "$AccountName",
* LinkConfiguration = new Aws.Oam.Inputs.LinkLinkConfigurationArgs
* {
* MetricConfiguration = new Aws.Oam.Inputs.LinkLinkConfigurationMetricConfigurationArgs
* {
* Filter = "Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')",
* },
* },
* ResourceTypes = new[]
* {
* "AWS::CloudWatch::Metric",
* },
* SinkIdentifier = test.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/oam"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := oam.NewLink(ctx, "example", &oam.LinkArgs{
* LabelTemplate: pulumi.String("$AccountName"),
* LinkConfiguration: &oam.LinkLinkConfigurationArgs{
* MetricConfiguration: &oam.LinkLinkConfigurationMetricConfigurationArgs{
* Filter: pulumi.String("Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')"),
* },
* },
* ResourceTypes: pulumi.StringArray{
* pulumi.String("AWS::CloudWatch::Metric"),
* },
* SinkIdentifier: pulumi.Any(test.Id),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.oam.Link;
* import com.pulumi.aws.oam.LinkArgs;
* import com.pulumi.aws.oam.inputs.LinkLinkConfigurationArgs;
* import com.pulumi.aws.oam.inputs.LinkLinkConfigurationMetricConfigurationArgs;
* 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 Link("example", LinkArgs.builder()
* .labelTemplate("$AccountName")
* .linkConfiguration(LinkLinkConfigurationArgs.builder()
* .metricConfiguration(LinkLinkConfigurationMetricConfigurationArgs.builder()
* .filter("Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')")
* .build())
* .build())
* .resourceTypes("AWS::CloudWatch::Metric")
* .sinkIdentifier(test.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:oam:Link
* properties:
* labelTemplate: $AccountName
* linkConfiguration:
* metricConfiguration:
* filter: Namespace IN ('AWS/EC2', 'AWS/ELB', 'AWS/S3')
* resourceTypes:
* - AWS::CloudWatch::Metric
* sinkIdentifier: ${test.id}
* ```
*
* ## Import
* Using `pulumi import`, import CloudWatch Observability Access Manager Link using the `arn`. For example:
* ```sh
* $ pulumi import aws:oam/link:Link example arn:aws:oam:us-west-2:123456789012:link/link-id
* ```
* @property labelTemplate Human-readable name to use to identify this source account when you are viewing data from it in the monitoring account.
* @property linkConfiguration Configuration for creating filters that specify that only some metric namespaces or log groups are to be shared from the source account to the monitoring account. See `link_configuration` Block for details.
* @property resourceTypes Types of data that the source account shares with the monitoring account.
* @property sinkIdentifier Identifier of the sink to use to create this link.
* The following arguments are optional:
* @property tags A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public data class LinkArgs(
public val labelTemplate: Output? = null,
public val linkConfiguration: Output? = null,
public val resourceTypes: Output>? = null,
public val sinkIdentifier: Output? = null,
public val tags: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy