aws logo
AWS Classic v5.29.0, Feb 1 23

aws.cloudfront.MonitoringSubscription

Provides a CloudFront real-time log configuration resource.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.CloudFront.MonitoringSubscription("example", new()
    {
        DistributionId = aws_cloudfront_distribution.Example.Id,
        MonitoringSubscriptionDetails = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionArgs
        {
            RealtimeMetricsSubscriptionConfig = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs
            {
                RealtimeMetricsSubscriptionStatus = "Enabled",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewMonitoringSubscription(ctx, "example", &cloudfront.MonitoringSubscriptionArgs{
			DistributionId: pulumi.Any(aws_cloudfront_distribution.Example.Id),
			MonitoringSubscription: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionArgs{
				RealtimeMetricsSubscriptionConfig: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs{
					RealtimeMetricsSubscriptionStatus: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.MonitoringSubscription;
import com.pulumi.aws.cloudfront.MonitoringSubscriptionArgs;
import com.pulumi.aws.cloudfront.inputs.MonitoringSubscriptionMonitoringSubscriptionArgs;
import com.pulumi.aws.cloudfront.inputs.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs;
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 MonitoringSubscription("example", MonitoringSubscriptionArgs.builder()        
            .distributionId(aws_cloudfront_distribution.example().id())
            .monitoringSubscription(MonitoringSubscriptionMonitoringSubscriptionArgs.builder()
                .realtimeMetricsSubscriptionConfig(MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs.builder()
                    .realtimeMetricsSubscriptionStatus("Enabled")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.MonitoringSubscription("example",
    distribution_id=aws_cloudfront_distribution["example"]["id"],
    monitoring_subscription=aws.cloudfront.MonitoringSubscriptionMonitoringSubscriptionArgs(
        realtime_metrics_subscription_config=aws.cloudfront.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs(
            realtime_metrics_subscription_status="Enabled",
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudfront.MonitoringSubscription("example", {
    distributionId: aws_cloudfront_distribution.example.id,
    monitoringSubscription: {
        realtimeMetricsSubscriptionConfig: {
            realtimeMetricsSubscriptionStatus: "Enabled",
        },
    },
});
resources:
  example:
    type: aws:cloudfront:MonitoringSubscription
    properties:
      distributionId: ${aws_cloudfront_distribution.example.id}
      monitoringSubscription:
        realtimeMetricsSubscriptionConfig:
          realtimeMetricsSubscriptionStatus: Enabled

Create MonitoringSubscription Resource

new MonitoringSubscription(name: string, args: MonitoringSubscriptionArgs, opts?: CustomResourceOptions);
@overload
def MonitoringSubscription(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           distribution_id: Optional[str] = None,
                           monitoring_subscription: Optional[MonitoringSubscriptionMonitoringSubscriptionArgs] = None)
@overload
def MonitoringSubscription(resource_name: str,
                           args: MonitoringSubscriptionArgs,
                           opts: Optional[ResourceOptions] = None)
func NewMonitoringSubscription(ctx *Context, name string, args MonitoringSubscriptionArgs, opts ...ResourceOption) (*MonitoringSubscription, error)
public MonitoringSubscription(string name, MonitoringSubscriptionArgs args, CustomResourceOptions? opts = null)
public MonitoringSubscription(String name, MonitoringSubscriptionArgs args)
public MonitoringSubscription(String name, MonitoringSubscriptionArgs args, CustomResourceOptions options)
type: aws:cloudfront:MonitoringSubscription
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args MonitoringSubscriptionArgs
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 MonitoringSubscriptionArgs
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 MonitoringSubscriptionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MonitoringSubscriptionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args MonitoringSubscriptionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

MonitoringSubscription Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The MonitoringSubscription resource accepts the following input properties:

DistributionId string

The ID of the distribution that you are enabling metrics for.

MonitoringSubscriptionDetails MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

DistributionId string

The ID of the distribution that you are enabling metrics for.

MonitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId String

The ID of the distribution that you are enabling metrics for.

monitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId string

The ID of the distribution that you are enabling metrics for.

monitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distribution_id str

The ID of the distribution that you are enabling metrics for.

monitoring_subscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId String

The ID of the distribution that you are enabling metrics for.

monitoringSubscription Property Map

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

Outputs

All input properties are implicitly available as output properties. Additionally, the MonitoringSubscription 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 MonitoringSubscription Resource

Get an existing MonitoringSubscription 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?: MonitoringSubscriptionState, opts?: CustomResourceOptions): MonitoringSubscription
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        distribution_id: Optional[str] = None,
        monitoring_subscription: Optional[MonitoringSubscriptionMonitoringSubscriptionArgs] = None) -> MonitoringSubscription
func GetMonitoringSubscription(ctx *Context, name string, id IDInput, state *MonitoringSubscriptionState, opts ...ResourceOption) (*MonitoringSubscription, error)
public static MonitoringSubscription Get(string name, Input<string> id, MonitoringSubscriptionState? state, CustomResourceOptions? opts = null)
public static MonitoringSubscription get(String name, Output<String> id, MonitoringSubscriptionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
DistributionId string

The ID of the distribution that you are enabling metrics for.

MonitoringSubscriptionDetails MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

DistributionId string

The ID of the distribution that you are enabling metrics for.

MonitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId String

The ID of the distribution that you are enabling metrics for.

monitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId string

The ID of the distribution that you are enabling metrics for.

monitoringSubscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distribution_id str

The ID of the distribution that you are enabling metrics for.

monitoring_subscription MonitoringSubscriptionMonitoringSubscriptionArgs

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

distributionId String

The ID of the distribution that you are enabling metrics for.

monitoringSubscription Property Map

A monitoring subscription. This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

Supporting Types

MonitoringSubscriptionMonitoringSubscription

RealtimeMetricsSubscriptionConfig MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfig

A subscription configuration for additional CloudWatch metrics. See below.

RealtimeMetricsSubscriptionConfig MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfig

A subscription configuration for additional CloudWatch metrics. See below.

realtimeMetricsSubscriptionConfig MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfig

A subscription configuration for additional CloudWatch metrics. See below.

realtimeMetricsSubscriptionConfig MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfig

A subscription configuration for additional CloudWatch metrics. See below.

realtimeMetricsSubscriptionConfig Property Map

A subscription configuration for additional CloudWatch metrics. See below.

MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfig

RealtimeMetricsSubscriptionStatus string

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

RealtimeMetricsSubscriptionStatus string

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

realtimeMetricsSubscriptionStatus String

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

realtimeMetricsSubscriptionStatus string

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

realtime_metrics_subscription_status str

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

realtimeMetricsSubscriptionStatus String

A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution. Valid values are Enabled and Disabled. See below.

Import

CloudFront monitoring subscription can be imported using the id, e.g.,

 $ pulumi import aws:cloudfront/monitoringSubscription:MonitoringSubscription example E3QYSUHO4VYRGB

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.