github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudwatch/metricStream.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package cloudwatch
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a CloudWatch Metric Stream resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Filters
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"fmt"
    28  //
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    31  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kinesis"
    32  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    33  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    34  //
    35  // )
    36  //
    37  //	func main() {
    38  //		pulumi.Run(func(ctx *pulumi.Context) error {
    39  //			// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
    40  //			streamsAssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    41  //				Statements: []iam.GetPolicyDocumentStatement{
    42  //					{
    43  //						Effect: pulumi.StringRef("Allow"),
    44  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    45  //							{
    46  //								Type: "Service",
    47  //								Identifiers: []string{
    48  //									"streams.metrics.cloudwatch.amazonaws.com",
    49  //								},
    50  //							},
    51  //						},
    52  //						Actions: []string{
    53  //							"sts:AssumeRole",
    54  //						},
    55  //					},
    56  //				},
    57  //			}, nil)
    58  //			if err != nil {
    59  //				return err
    60  //			}
    61  //			metricStreamToFirehoseRole, err := iam.NewRole(ctx, "metric_stream_to_firehose", &iam.RoleArgs{
    62  //				Name:             pulumi.String("metric_stream_to_firehose_role"),
    63  //				AssumeRolePolicy: pulumi.String(streamsAssumeRole.Json),
    64  //			})
    65  //			if err != nil {
    66  //				return err
    67  //			}
    68  //			bucket, err := s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{
    69  //				Bucket: pulumi.String("metric-stream-test-bucket"),
    70  //			})
    71  //			if err != nil {
    72  //				return err
    73  //			}
    74  //			firehoseAssumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    75  //				Statements: []iam.GetPolicyDocumentStatement{
    76  //					{
    77  //						Effect: pulumi.StringRef("Allow"),
    78  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    79  //							{
    80  //								Type: "Service",
    81  //								Identifiers: []string{
    82  //									"firehose.amazonaws.com",
    83  //								},
    84  //							},
    85  //						},
    86  //						Actions: []string{
    87  //							"sts:AssumeRole",
    88  //						},
    89  //					},
    90  //				},
    91  //			}, nil)
    92  //			if err != nil {
    93  //				return err
    94  //			}
    95  //			firehoseToS3Role, err := iam.NewRole(ctx, "firehose_to_s3", &iam.RoleArgs{
    96  //				AssumeRolePolicy: pulumi.String(firehoseAssumeRole.Json),
    97  //			})
    98  //			if err != nil {
    99  //				return err
   100  //			}
   101  //			s3Stream, err := kinesis.NewFirehoseDeliveryStream(ctx, "s3_stream", &kinesis.FirehoseDeliveryStreamArgs{
   102  //				Name:        pulumi.String("metric-stream-test-stream"),
   103  //				Destination: pulumi.String("extended_s3"),
   104  //				ExtendedS3Configuration: &kinesis.FirehoseDeliveryStreamExtendedS3ConfigurationArgs{
   105  //					RoleArn:   firehoseToS3Role.Arn,
   106  //					BucketArn: bucket.Arn,
   107  //				},
   108  //			})
   109  //			if err != nil {
   110  //				return err
   111  //			}
   112  //			_, err = cloudwatch.NewMetricStream(ctx, "main", &cloudwatch.MetricStreamArgs{
   113  //				Name:         pulumi.String("my-metric-stream"),
   114  //				RoleArn:      metricStreamToFirehoseRole.Arn,
   115  //				FirehoseArn:  s3Stream.Arn,
   116  //				OutputFormat: pulumi.String("json"),
   117  //				IncludeFilters: cloudwatch.MetricStreamIncludeFilterArray{
   118  //					&cloudwatch.MetricStreamIncludeFilterArgs{
   119  //						Namespace: pulumi.String("AWS/EC2"),
   120  //						MetricNames: pulumi.StringArray{
   121  //							pulumi.String("CPUUtilization"),
   122  //							pulumi.String("NetworkOut"),
   123  //						},
   124  //					},
   125  //					&cloudwatch.MetricStreamIncludeFilterArgs{
   126  //						Namespace:   pulumi.String("AWS/EBS"),
   127  //						MetricNames: pulumi.StringArray{},
   128  //					},
   129  //				},
   130  //			})
   131  //			if err != nil {
   132  //				return err
   133  //			}
   134  //			// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
   135  //			metricStreamToFirehose := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
   136  //				Statements: iam.GetPolicyDocumentStatementArray{
   137  //					&iam.GetPolicyDocumentStatementArgs{
   138  //						Effect: pulumi.String("Allow"),
   139  //						Actions: pulumi.StringArray{
   140  //							pulumi.String("firehose:PutRecord"),
   141  //							pulumi.String("firehose:PutRecordBatch"),
   142  //						},
   143  //						Resources: pulumi.StringArray{
   144  //							s3Stream.Arn,
   145  //						},
   146  //					},
   147  //				},
   148  //			}, nil)
   149  //			_, err = iam.NewRolePolicy(ctx, "metric_stream_to_firehose", &iam.RolePolicyArgs{
   150  //				Name: pulumi.String("default"),
   151  //				Role: metricStreamToFirehoseRole.ID(),
   152  //				Policy: metricStreamToFirehose.ApplyT(func(metricStreamToFirehose iam.GetPolicyDocumentResult) (*string, error) {
   153  //					return &metricStreamToFirehose.Json, nil
   154  //				}).(pulumi.StringPtrOutput),
   155  //			})
   156  //			if err != nil {
   157  //				return err
   158  //			}
   159  //			_, err = s3.NewBucketAclV2(ctx, "bucket_acl", &s3.BucketAclV2Args{
   160  //				Bucket: bucket.ID(),
   161  //				Acl:    pulumi.String("private"),
   162  //			})
   163  //			if err != nil {
   164  //				return err
   165  //			}
   166  //			firehoseToS3 := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
   167  //				Statements: iam.GetPolicyDocumentStatementArray{
   168  //					&iam.GetPolicyDocumentStatementArgs{
   169  //						Effect: pulumi.String("Allow"),
   170  //						Actions: pulumi.StringArray{
   171  //							pulumi.String("s3:AbortMultipartUpload"),
   172  //							pulumi.String("s3:GetBucketLocation"),
   173  //							pulumi.String("s3:GetObject"),
   174  //							pulumi.String("s3:ListBucket"),
   175  //							pulumi.String("s3:ListBucketMultipartUploads"),
   176  //							pulumi.String("s3:PutObject"),
   177  //						},
   178  //						Resources: pulumi.StringArray{
   179  //							bucket.Arn,
   180  //							bucket.Arn.ApplyT(func(arn string) (string, error) {
   181  //								return fmt.Sprintf("%v/*", arn), nil
   182  //							}).(pulumi.StringOutput),
   183  //						},
   184  //					},
   185  //				},
   186  //			}, nil)
   187  //			_, err = iam.NewRolePolicy(ctx, "firehose_to_s3", &iam.RolePolicyArgs{
   188  //				Name: pulumi.String("default"),
   189  //				Role: firehoseToS3Role.ID(),
   190  //				Policy: firehoseToS3.ApplyT(func(firehoseToS3 iam.GetPolicyDocumentResult) (*string, error) {
   191  //					return &firehoseToS3.Json, nil
   192  //				}).(pulumi.StringPtrOutput),
   193  //			})
   194  //			if err != nil {
   195  //				return err
   196  //			}
   197  //			return nil
   198  //		})
   199  //	}
   200  //
   201  // ```
   202  // <!--End PulumiCodeChooser -->
   203  //
   204  // ### Additional Statistics
   205  //
   206  // <!--Start PulumiCodeChooser -->
   207  // ```go
   208  // package main
   209  //
   210  // import (
   211  //
   212  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
   213  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   214  //
   215  // )
   216  //
   217  //	func main() {
   218  //		pulumi.Run(func(ctx *pulumi.Context) error {
   219  //			_, err := cloudwatch.NewMetricStream(ctx, "main", &cloudwatch.MetricStreamArgs{
   220  //				Name:         pulumi.String("my-metric-stream"),
   221  //				RoleArn:      pulumi.Any(metricStreamToFirehose.Arn),
   222  //				FirehoseArn:  pulumi.Any(s3Stream.Arn),
   223  //				OutputFormat: pulumi.String("json"),
   224  //				StatisticsConfigurations: cloudwatch.MetricStreamStatisticsConfigurationArray{
   225  //					&cloudwatch.MetricStreamStatisticsConfigurationArgs{
   226  //						AdditionalStatistics: pulumi.StringArray{
   227  //							pulumi.String("p1"),
   228  //							pulumi.String("tm99"),
   229  //						},
   230  //						IncludeMetrics: cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArray{
   231  //							&cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs{
   232  //								MetricName: pulumi.String("CPUUtilization"),
   233  //								Namespace:  pulumi.String("AWS/EC2"),
   234  //							},
   235  //						},
   236  //					},
   237  //					&cloudwatch.MetricStreamStatisticsConfigurationArgs{
   238  //						AdditionalStatistics: pulumi.StringArray{
   239  //							pulumi.String("TS(50.5:)"),
   240  //						},
   241  //						IncludeMetrics: cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArray{
   242  //							&cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs{
   243  //								MetricName: pulumi.String("CPUUtilization"),
   244  //								Namespace:  pulumi.String("AWS/EC2"),
   245  //							},
   246  //						},
   247  //					},
   248  //				},
   249  //			})
   250  //			if err != nil {
   251  //				return err
   252  //			}
   253  //			return nil
   254  //		})
   255  //	}
   256  //
   257  // ```
   258  // <!--End PulumiCodeChooser -->
   259  //
   260  // ## Import
   261  //
   262  // Using `pulumi import`, import CloudWatch metric streams using the `name`. For example:
   263  //
   264  // ```sh
   265  // $ pulumi import aws:cloudwatch/metricStream:MetricStream sample sample-stream-name
   266  // ```
   267  type MetricStream struct {
   268  	pulumi.CustomResourceState
   269  
   270  	// ARN of the metric stream.
   271  	Arn pulumi.StringOutput `pulumi:"arn"`
   272  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was created.
   273  	CreationDate pulumi.StringOutput `pulumi:"creationDate"`
   274  	// List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   275  	ExcludeFilters MetricStreamExcludeFilterArrayOutput `pulumi:"excludeFilters"`
   276  	// ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   277  	FirehoseArn pulumi.StringOutput `pulumi:"firehoseArn"`
   278  	// List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   279  	IncludeFilters MetricStreamIncludeFilterArrayOutput `pulumi:"includeFilters"`
   280  	// If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   281  	IncludeLinkedAccountsMetrics pulumi.BoolPtrOutput `pulumi:"includeLinkedAccountsMetrics"`
   282  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was last updated.
   283  	LastUpdateDate pulumi.StringOutput `pulumi:"lastUpdateDate"`
   284  	// Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   285  	Name pulumi.StringOutput `pulumi:"name"`
   286  	// Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   287  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
   288  	// Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   289  	//
   290  	// The following arguments are optional:
   291  	OutputFormat pulumi.StringOutput `pulumi:"outputFormat"`
   292  	// ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   293  	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
   294  	// State of the metric stream. Possible values are `running` and `stopped`.
   295  	State pulumi.StringOutput `pulumi:"state"`
   296  	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   297  	StatisticsConfigurations MetricStreamStatisticsConfigurationArrayOutput `pulumi:"statisticsConfigurations"`
   298  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   299  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   300  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   301  	//
   302  	// Deprecated: Please use `tags` instead.
   303  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   304  }
   305  
   306  // NewMetricStream registers a new resource with the given unique name, arguments, and options.
   307  func NewMetricStream(ctx *pulumi.Context,
   308  	name string, args *MetricStreamArgs, opts ...pulumi.ResourceOption) (*MetricStream, error) {
   309  	if args == nil {
   310  		return nil, errors.New("missing one or more required arguments")
   311  	}
   312  
   313  	if args.FirehoseArn == nil {
   314  		return nil, errors.New("invalid value for required argument 'FirehoseArn'")
   315  	}
   316  	if args.OutputFormat == nil {
   317  		return nil, errors.New("invalid value for required argument 'OutputFormat'")
   318  	}
   319  	if args.RoleArn == nil {
   320  		return nil, errors.New("invalid value for required argument 'RoleArn'")
   321  	}
   322  	opts = internal.PkgResourceDefaultOpts(opts)
   323  	var resource MetricStream
   324  	err := ctx.RegisterResource("aws:cloudwatch/metricStream:MetricStream", name, args, &resource, opts...)
   325  	if err != nil {
   326  		return nil, err
   327  	}
   328  	return &resource, nil
   329  }
   330  
   331  // GetMetricStream gets an existing MetricStream resource's state with the given name, ID, and optional
   332  // state properties that are used to uniquely qualify the lookup (nil if not required).
   333  func GetMetricStream(ctx *pulumi.Context,
   334  	name string, id pulumi.IDInput, state *MetricStreamState, opts ...pulumi.ResourceOption) (*MetricStream, error) {
   335  	var resource MetricStream
   336  	err := ctx.ReadResource("aws:cloudwatch/metricStream:MetricStream", name, id, state, &resource, opts...)
   337  	if err != nil {
   338  		return nil, err
   339  	}
   340  	return &resource, nil
   341  }
   342  
   343  // Input properties used for looking up and filtering MetricStream resources.
   344  type metricStreamState struct {
   345  	// ARN of the metric stream.
   346  	Arn *string `pulumi:"arn"`
   347  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was created.
   348  	CreationDate *string `pulumi:"creationDate"`
   349  	// List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   350  	ExcludeFilters []MetricStreamExcludeFilter `pulumi:"excludeFilters"`
   351  	// ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   352  	FirehoseArn *string `pulumi:"firehoseArn"`
   353  	// List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   354  	IncludeFilters []MetricStreamIncludeFilter `pulumi:"includeFilters"`
   355  	// If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   356  	IncludeLinkedAccountsMetrics *bool `pulumi:"includeLinkedAccountsMetrics"`
   357  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was last updated.
   358  	LastUpdateDate *string `pulumi:"lastUpdateDate"`
   359  	// Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   360  	Name *string `pulumi:"name"`
   361  	// Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   362  	NamePrefix *string `pulumi:"namePrefix"`
   363  	// Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   364  	//
   365  	// The following arguments are optional:
   366  	OutputFormat *string `pulumi:"outputFormat"`
   367  	// ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   368  	RoleArn *string `pulumi:"roleArn"`
   369  	// State of the metric stream. Possible values are `running` and `stopped`.
   370  	State *string `pulumi:"state"`
   371  	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   372  	StatisticsConfigurations []MetricStreamStatisticsConfiguration `pulumi:"statisticsConfigurations"`
   373  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   374  	Tags map[string]string `pulumi:"tags"`
   375  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   376  	//
   377  	// Deprecated: Please use `tags` instead.
   378  	TagsAll map[string]string `pulumi:"tagsAll"`
   379  }
   380  
   381  type MetricStreamState struct {
   382  	// ARN of the metric stream.
   383  	Arn pulumi.StringPtrInput
   384  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was created.
   385  	CreationDate pulumi.StringPtrInput
   386  	// List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   387  	ExcludeFilters MetricStreamExcludeFilterArrayInput
   388  	// ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   389  	FirehoseArn pulumi.StringPtrInput
   390  	// List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   391  	IncludeFilters MetricStreamIncludeFilterArrayInput
   392  	// If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   393  	IncludeLinkedAccountsMetrics pulumi.BoolPtrInput
   394  	// Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was last updated.
   395  	LastUpdateDate pulumi.StringPtrInput
   396  	// Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   397  	Name pulumi.StringPtrInput
   398  	// Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   399  	NamePrefix pulumi.StringPtrInput
   400  	// Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   401  	//
   402  	// The following arguments are optional:
   403  	OutputFormat pulumi.StringPtrInput
   404  	// ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   405  	RoleArn pulumi.StringPtrInput
   406  	// State of the metric stream. Possible values are `running` and `stopped`.
   407  	State pulumi.StringPtrInput
   408  	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   409  	StatisticsConfigurations MetricStreamStatisticsConfigurationArrayInput
   410  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   411  	Tags pulumi.StringMapInput
   412  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   413  	//
   414  	// Deprecated: Please use `tags` instead.
   415  	TagsAll pulumi.StringMapInput
   416  }
   417  
   418  func (MetricStreamState) ElementType() reflect.Type {
   419  	return reflect.TypeOf((*metricStreamState)(nil)).Elem()
   420  }
   421  
   422  type metricStreamArgs struct {
   423  	// List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   424  	ExcludeFilters []MetricStreamExcludeFilter `pulumi:"excludeFilters"`
   425  	// ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   426  	FirehoseArn string `pulumi:"firehoseArn"`
   427  	// List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   428  	IncludeFilters []MetricStreamIncludeFilter `pulumi:"includeFilters"`
   429  	// If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   430  	IncludeLinkedAccountsMetrics *bool `pulumi:"includeLinkedAccountsMetrics"`
   431  	// Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   432  	Name *string `pulumi:"name"`
   433  	// Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   434  	NamePrefix *string `pulumi:"namePrefix"`
   435  	// Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   436  	//
   437  	// The following arguments are optional:
   438  	OutputFormat string `pulumi:"outputFormat"`
   439  	// ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   440  	RoleArn string `pulumi:"roleArn"`
   441  	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   442  	StatisticsConfigurations []MetricStreamStatisticsConfiguration `pulumi:"statisticsConfigurations"`
   443  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   444  	Tags map[string]string `pulumi:"tags"`
   445  }
   446  
   447  // The set of arguments for constructing a MetricStream resource.
   448  type MetricStreamArgs struct {
   449  	// List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   450  	ExcludeFilters MetricStreamExcludeFilterArrayInput
   451  	// ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   452  	FirehoseArn pulumi.StringInput
   453  	// List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   454  	IncludeFilters MetricStreamIncludeFilterArrayInput
   455  	// If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   456  	IncludeLinkedAccountsMetrics pulumi.BoolPtrInput
   457  	// Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   458  	Name pulumi.StringPtrInput
   459  	// Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   460  	NamePrefix pulumi.StringPtrInput
   461  	// Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   462  	//
   463  	// The following arguments are optional:
   464  	OutputFormat pulumi.StringInput
   465  	// ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   466  	RoleArn pulumi.StringInput
   467  	// For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   468  	StatisticsConfigurations MetricStreamStatisticsConfigurationArrayInput
   469  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   470  	Tags pulumi.StringMapInput
   471  }
   472  
   473  func (MetricStreamArgs) ElementType() reflect.Type {
   474  	return reflect.TypeOf((*metricStreamArgs)(nil)).Elem()
   475  }
   476  
   477  type MetricStreamInput interface {
   478  	pulumi.Input
   479  
   480  	ToMetricStreamOutput() MetricStreamOutput
   481  	ToMetricStreamOutputWithContext(ctx context.Context) MetricStreamOutput
   482  }
   483  
   484  func (*MetricStream) ElementType() reflect.Type {
   485  	return reflect.TypeOf((**MetricStream)(nil)).Elem()
   486  }
   487  
   488  func (i *MetricStream) ToMetricStreamOutput() MetricStreamOutput {
   489  	return i.ToMetricStreamOutputWithContext(context.Background())
   490  }
   491  
   492  func (i *MetricStream) ToMetricStreamOutputWithContext(ctx context.Context) MetricStreamOutput {
   493  	return pulumi.ToOutputWithContext(ctx, i).(MetricStreamOutput)
   494  }
   495  
   496  // MetricStreamArrayInput is an input type that accepts MetricStreamArray and MetricStreamArrayOutput values.
   497  // You can construct a concrete instance of `MetricStreamArrayInput` via:
   498  //
   499  //	MetricStreamArray{ MetricStreamArgs{...} }
   500  type MetricStreamArrayInput interface {
   501  	pulumi.Input
   502  
   503  	ToMetricStreamArrayOutput() MetricStreamArrayOutput
   504  	ToMetricStreamArrayOutputWithContext(context.Context) MetricStreamArrayOutput
   505  }
   506  
   507  type MetricStreamArray []MetricStreamInput
   508  
   509  func (MetricStreamArray) ElementType() reflect.Type {
   510  	return reflect.TypeOf((*[]*MetricStream)(nil)).Elem()
   511  }
   512  
   513  func (i MetricStreamArray) ToMetricStreamArrayOutput() MetricStreamArrayOutput {
   514  	return i.ToMetricStreamArrayOutputWithContext(context.Background())
   515  }
   516  
   517  func (i MetricStreamArray) ToMetricStreamArrayOutputWithContext(ctx context.Context) MetricStreamArrayOutput {
   518  	return pulumi.ToOutputWithContext(ctx, i).(MetricStreamArrayOutput)
   519  }
   520  
   521  // MetricStreamMapInput is an input type that accepts MetricStreamMap and MetricStreamMapOutput values.
   522  // You can construct a concrete instance of `MetricStreamMapInput` via:
   523  //
   524  //	MetricStreamMap{ "key": MetricStreamArgs{...} }
   525  type MetricStreamMapInput interface {
   526  	pulumi.Input
   527  
   528  	ToMetricStreamMapOutput() MetricStreamMapOutput
   529  	ToMetricStreamMapOutputWithContext(context.Context) MetricStreamMapOutput
   530  }
   531  
   532  type MetricStreamMap map[string]MetricStreamInput
   533  
   534  func (MetricStreamMap) ElementType() reflect.Type {
   535  	return reflect.TypeOf((*map[string]*MetricStream)(nil)).Elem()
   536  }
   537  
   538  func (i MetricStreamMap) ToMetricStreamMapOutput() MetricStreamMapOutput {
   539  	return i.ToMetricStreamMapOutputWithContext(context.Background())
   540  }
   541  
   542  func (i MetricStreamMap) ToMetricStreamMapOutputWithContext(ctx context.Context) MetricStreamMapOutput {
   543  	return pulumi.ToOutputWithContext(ctx, i).(MetricStreamMapOutput)
   544  }
   545  
   546  type MetricStreamOutput struct{ *pulumi.OutputState }
   547  
   548  func (MetricStreamOutput) ElementType() reflect.Type {
   549  	return reflect.TypeOf((**MetricStream)(nil)).Elem()
   550  }
   551  
   552  func (o MetricStreamOutput) ToMetricStreamOutput() MetricStreamOutput {
   553  	return o
   554  }
   555  
   556  func (o MetricStreamOutput) ToMetricStreamOutputWithContext(ctx context.Context) MetricStreamOutput {
   557  	return o
   558  }
   559  
   560  // ARN of the metric stream.
   561  func (o MetricStreamOutput) Arn() pulumi.StringOutput {
   562  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   563  }
   564  
   565  // Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was created.
   566  func (o MetricStreamOutput) CreationDate() pulumi.StringOutput {
   567  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.CreationDate }).(pulumi.StringOutput)
   568  }
   569  
   570  // List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces and the conditional metric names that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is excluded. Conflicts with `includeFilter`.
   571  func (o MetricStreamOutput) ExcludeFilters() MetricStreamExcludeFilterArrayOutput {
   572  	return o.ApplyT(func(v *MetricStream) MetricStreamExcludeFilterArrayOutput { return v.ExcludeFilters }).(MetricStreamExcludeFilterArrayOutput)
   573  }
   574  
   575  // ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.
   576  func (o MetricStreamOutput) FirehoseArn() pulumi.StringOutput {
   577  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.FirehoseArn }).(pulumi.StringOutput)
   578  }
   579  
   580  // List of inclusive metric filters. If you specify this parameter, the stream sends only the conditional metric names from the metric namespaces that you specify here. If you don't specify metric names or provide empty metric names whole metric namespace is included. Conflicts with `excludeFilter`.
   581  func (o MetricStreamOutput) IncludeFilters() MetricStreamIncludeFilterArrayOutput {
   582  	return o.ApplyT(func(v *MetricStream) MetricStreamIncludeFilterArrayOutput { return v.IncludeFilters }).(MetricStreamIncludeFilterArrayOutput)
   583  }
   584  
   585  // If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream. The default is false. For more information about linking accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).
   586  func (o MetricStreamOutput) IncludeLinkedAccountsMetrics() pulumi.BoolPtrOutput {
   587  	return o.ApplyT(func(v *MetricStream) pulumi.BoolPtrOutput { return v.IncludeLinkedAccountsMetrics }).(pulumi.BoolPtrOutput)
   588  }
   589  
   590  // Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) that the metric stream was last updated.
   591  func (o MetricStreamOutput) LastUpdateDate() pulumi.StringOutput {
   592  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.LastUpdateDate }).(pulumi.StringOutput)
   593  }
   594  
   595  // Friendly name of the metric stream. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   596  func (o MetricStreamOutput) Name() pulumi.StringOutput {
   597  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   598  }
   599  
   600  // Creates a unique friendly name beginning with the specified prefix. Conflicts with `name`.
   601  func (o MetricStreamOutput) NamePrefix() pulumi.StringOutput {
   602  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   603  }
   604  
   605  // Output format for the stream. Possible values are `json`, `opentelemetry0.7`, and `opentelemetry1.0`. For more information about output formats, see [Metric streams output formats](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html).
   606  //
   607  // The following arguments are optional:
   608  func (o MetricStreamOutput) OutputFormat() pulumi.StringOutput {
   609  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.OutputFormat }).(pulumi.StringOutput)
   610  }
   611  
   612  // ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see [Trust between CloudWatch and Kinesis Data Firehose](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html).
   613  func (o MetricStreamOutput) RoleArn() pulumi.StringOutput {
   614  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
   615  }
   616  
   617  // State of the metric stream. Possible values are `running` and `stopped`.
   618  func (o MetricStreamOutput) State() pulumi.StringOutput {
   619  	return o.ApplyT(func(v *MetricStream) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
   620  }
   621  
   622  // For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's `outputFormat`. If the OutputFormat is `json`, you can stream any additional statistic that is supported by CloudWatch, listed in [CloudWatch statistics definitions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.html). If the OutputFormat is `opentelemetry0.7` or `opentelemetry1.0`, you can stream percentile statistics (p99 etc.). See details below.
   623  func (o MetricStreamOutput) StatisticsConfigurations() MetricStreamStatisticsConfigurationArrayOutput {
   624  	return o.ApplyT(func(v *MetricStream) MetricStreamStatisticsConfigurationArrayOutput {
   625  		return v.StatisticsConfigurations
   626  	}).(MetricStreamStatisticsConfigurationArrayOutput)
   627  }
   628  
   629  // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   630  func (o MetricStreamOutput) Tags() pulumi.StringMapOutput {
   631  	return o.ApplyT(func(v *MetricStream) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   632  }
   633  
   634  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   635  //
   636  // Deprecated: Please use `tags` instead.
   637  func (o MetricStreamOutput) TagsAll() pulumi.StringMapOutput {
   638  	return o.ApplyT(func(v *MetricStream) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   639  }
   640  
   641  type MetricStreamArrayOutput struct{ *pulumi.OutputState }
   642  
   643  func (MetricStreamArrayOutput) ElementType() reflect.Type {
   644  	return reflect.TypeOf((*[]*MetricStream)(nil)).Elem()
   645  }
   646  
   647  func (o MetricStreamArrayOutput) ToMetricStreamArrayOutput() MetricStreamArrayOutput {
   648  	return o
   649  }
   650  
   651  func (o MetricStreamArrayOutput) ToMetricStreamArrayOutputWithContext(ctx context.Context) MetricStreamArrayOutput {
   652  	return o
   653  }
   654  
   655  func (o MetricStreamArrayOutput) Index(i pulumi.IntInput) MetricStreamOutput {
   656  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MetricStream {
   657  		return vs[0].([]*MetricStream)[vs[1].(int)]
   658  	}).(MetricStreamOutput)
   659  }
   660  
   661  type MetricStreamMapOutput struct{ *pulumi.OutputState }
   662  
   663  func (MetricStreamMapOutput) ElementType() reflect.Type {
   664  	return reflect.TypeOf((*map[string]*MetricStream)(nil)).Elem()
   665  }
   666  
   667  func (o MetricStreamMapOutput) ToMetricStreamMapOutput() MetricStreamMapOutput {
   668  	return o
   669  }
   670  
   671  func (o MetricStreamMapOutput) ToMetricStreamMapOutputWithContext(ctx context.Context) MetricStreamMapOutput {
   672  	return o
   673  }
   674  
   675  func (o MetricStreamMapOutput) MapIndex(k pulumi.StringInput) MetricStreamOutput {
   676  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MetricStream {
   677  		return vs[0].(map[string]*MetricStream)[vs[1].(string)]
   678  	}).(MetricStreamOutput)
   679  }
   680  
   681  func init() {
   682  	pulumi.RegisterInputType(reflect.TypeOf((*MetricStreamInput)(nil)).Elem(), &MetricStream{})
   683  	pulumi.RegisterInputType(reflect.TypeOf((*MetricStreamArrayInput)(nil)).Elem(), MetricStreamArray{})
   684  	pulumi.RegisterInputType(reflect.TypeOf((*MetricStreamMapInput)(nil)).Elem(), MetricStreamMap{})
   685  	pulumi.RegisterOutputType(MetricStreamOutput{})
   686  	pulumi.RegisterOutputType(MetricStreamArrayOutput{})
   687  	pulumi.RegisterOutputType(MetricStreamMapOutput{})
   688  }