1. Packages
  2. AWS
  3. API Docs
  4. cloudfront
  5. MonitoringSubscription
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

aws.cloudfront.MonitoringSubscription

Explore with Pulumi AI

aws logo
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

    Provides a CloudFront real-time log configuration resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudfront.MonitoringSubscription("example", {
        distributionId: exampleAwsCloudfrontDistribution.id,
        monitoringSubscription: {
            realtimeMetricsSubscriptionConfig: {
                realtimeMetricsSubscriptionStatus: "Enabled",
            },
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.MonitoringSubscription("example",
        distribution_id=example_aws_cloudfront_distribution["id"],
        monitoring_subscription={
            "realtime_metrics_subscription_config": {
                "realtime_metrics_subscription_status": "Enabled",
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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(exampleAwsCloudfrontDistribution.Id),
    			MonitoringSubscription: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionArgs{
    				RealtimeMetricsSubscriptionConfig: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs{
    					RealtimeMetricsSubscriptionStatus: pulumi.String("Enabled"),
    				},
    			},
    		})
    		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.CloudFront.MonitoringSubscription("example", new()
        {
            DistributionId = exampleAwsCloudfrontDistribution.Id,
            MonitoringSubscriptionDetails = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionArgs
            {
                RealtimeMetricsSubscriptionConfig = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs
                {
                    RealtimeMetricsSubscriptionStatus = "Enabled",
                },
            },
        });
    
    });
    
    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(exampleAwsCloudfrontDistribution.id())
                .monitoringSubscription(MonitoringSubscriptionMonitoringSubscriptionArgs.builder()
                    .realtimeMetricsSubscriptionConfig(MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs.builder()
                        .realtimeMetricsSubscriptionStatus("Enabled")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:MonitoringSubscription
        properties:
          distributionId: ${exampleAwsCloudfrontDistribution.id}
          monitoringSubscription:
            realtimeMetricsSubscriptionConfig:
              realtimeMetricsSubscriptionStatus: Enabled
    

    Create MonitoringSubscription Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MonitoringSubscription(name: string, args: MonitoringSubscriptionArgs, opts?: CustomResourceOptions);
    @overload
    def MonitoringSubscription(resource_name: str,
                               args: MonitoringSubscriptionArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitoringSubscription(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               distribution_id: Optional[str] = None,
                               monitoring_subscription: Optional[MonitoringSubscriptionMonitoringSubscriptionArgs] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var monitoringSubscriptionResource = new Aws.CloudFront.MonitoringSubscription("monitoringSubscriptionResource", new()
    {
        DistributionId = "string",
        MonitoringSubscriptionDetails = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionArgs
        {
            RealtimeMetricsSubscriptionConfig = new Aws.CloudFront.Inputs.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs
            {
                RealtimeMetricsSubscriptionStatus = "string",
            },
        },
    });
    
    example, err := cloudfront.NewMonitoringSubscription(ctx, "monitoringSubscriptionResource", &cloudfront.MonitoringSubscriptionArgs{
    	DistributionId: pulumi.String("string"),
    	MonitoringSubscription: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionArgs{
    		RealtimeMetricsSubscriptionConfig: &cloudfront.MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs{
    			RealtimeMetricsSubscriptionStatus: pulumi.String("string"),
    		},
    	},
    })
    
    var monitoringSubscriptionResource = new MonitoringSubscription("monitoringSubscriptionResource", MonitoringSubscriptionArgs.builder()
        .distributionId("string")
        .monitoringSubscription(MonitoringSubscriptionMonitoringSubscriptionArgs.builder()
            .realtimeMetricsSubscriptionConfig(MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs.builder()
                .realtimeMetricsSubscriptionStatus("string")
                .build())
            .build())
        .build());
    
    monitoring_subscription_resource = aws.cloudfront.MonitoringSubscription("monitoringSubscriptionResource",
        distribution_id="string",
        monitoring_subscription={
            "realtimeMetricsSubscriptionConfig": {
                "realtimeMetricsSubscriptionStatus": "string",
            },
        })
    
    const monitoringSubscriptionResource = new aws.cloudfront.MonitoringSubscription("monitoringSubscriptionResource", {
        distributionId: "string",
        monitoringSubscription: {
            realtimeMetricsSubscriptionConfig: {
                realtimeMetricsSubscriptionStatus: "string",
            },
        },
    });
    
    type: aws:cloudfront:MonitoringSubscription
    properties:
        distributionId: string
        monitoringSubscription:
            realtimeMetricsSubscriptionConfig:
                realtimeMetricsSubscriptionStatus: string
    

    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 MonitoringSubscriptionMonitoringSubscription
    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 MonitoringSubscriptionMonitoringSubscription
    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 MonitoringSubscriptionMonitoringSubscription
    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 MonitoringSubscriptionMonitoringSubscription
    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 MonitoringSubscriptionMonitoringSubscription
    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 MonitoringSubscriptionMonitoringSubscription
    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, MonitoringSubscriptionMonitoringSubscriptionArgs

    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, MonitoringSubscriptionMonitoringSubscriptionRealtimeMetricsSubscriptionConfigArgs

    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

    Using pulumi import, import CloudFront monitoring subscription using the id. For example:

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

    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.
    aws logo
    AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi