Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

MonitoringSubscription

Provides a CloudFront real-time log configuration resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.CloudFront.MonitoringSubscription("example", new Aws.CloudFront.MonitoringSubscriptionArgs
        {
            DistributionId = aws_cloudfront_distribution.Example.Id,
            MonitoringSubscription = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionArgs
            {
                RealtimeMetricsSubscriptionConfig = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs
                {
                    RealtimeMetricsSubscriptionStatus = "Enabled",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/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
	})
}
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",
        },
    },
});

Create a 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)
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.

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.
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.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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.

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.
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.

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.

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.
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.

Import

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.