Exemple #1
0
 public MyStack()
 {
     var example = new Aws.ElasticSearch.Domain("example", new Aws.ElasticSearch.DomainArgs
     {
         ElasticsearchVersion = "2.3",
     });
     var main = new Aws.ElasticSearch.DomainPolicy("main", new Aws.ElasticSearch.DomainPolicyArgs
     {
         AccessPolicies = example.Arn.Apply(arn => @$ "{{
 " "Version" ": " "2012-10-17" ",
 " "Statement" ": [
Exemple #2
0
 public MyStack()
 {
     var testCluster = new Aws.ElasticSearch.Domain("testCluster", new Aws.ElasticSearch.DomainArgs
     {
     });
     var testStream = new Aws.Kinesis.FirehoseDeliveryStream("testStream", new Aws.Kinesis.FirehoseDeliveryStreamArgs
     {
         Destination = "elasticsearch",
         ElasticsearchConfiguration = new Aws.Kinesis.Inputs.FirehoseDeliveryStreamElasticsearchConfigurationArgs
         {
             DomainArn = testCluster.Arn,
             IndexName = "test",
             ProcessingConfiguration = new Aws.Kinesis.Inputs.FirehoseDeliveryStreamElasticsearchConfigurationProcessingConfigurationArgs
             {
                 Enabled    = true,
                 Processors =
                 {
                     new Aws.Kinesis.Inputs.FirehoseDeliveryStreamElasticsearchConfigurationProcessingConfigurationProcessorArgs
                     {
                         Parameters =
                         {
                             new Aws.Kinesis.Inputs.FirehoseDeliveryStreamElasticsearchConfigurationProcessingConfigurationProcessorParameterArgs
                             {
                                 ParameterName  = "LambdaArn",
                                 ParameterValue = $"{aws_lambda_function.Lambda_processor.Arn}:$LATEST",
                             },
                         },
                         Type = "Lambda",
                     },
                 },
             },
             RoleArn  = aws_iam_role.Firehose_role.Arn,
             TypeName = "test",
         },
         S3Configuration = new Aws.Kinesis.Inputs.FirehoseDeliveryStreamS3ConfigurationArgs
         {
             BucketArn         = aws_s3_bucket.Bucket.Arn,
             BufferInterval    = 400,
             BufferSize        = 10,
             CompressionFormat = "GZIP",
             RoleArn           = aws_iam_role.Firehose_role.Arn,
         },
     });
 }
Exemple #3
0
 public MyStack()
 {
     var example = new Aws.ElasticSearch.Domain("example", new Aws.ElasticSearch.DomainArgs
     {
         ClusterConfig = new Aws.ElasticSearch.Inputs.DomainClusterConfigArgs
         {
             ClusterConfig = "r4.large.elasticsearch",
         },
         ElasticsearchVersion = "1.5",
         SnapshotOptions      = new Aws.ElasticSearch.Inputs.DomainSnapshotOptionsArgs
         {
             SnapshotOptions = 23,
         },
         Tags =
         {
             { "Domain", "TestDomain" },
         },
     });
 }
Exemple #4
0
    public MyStack()
    {
        var exampleLogGroup = new Aws.CloudWatch.LogGroup("exampleLogGroup", new Aws.CloudWatch.LogGroupArgs
        {
        });
        var exampleLogResourcePolicy = new Aws.CloudWatch.LogResourcePolicy("exampleLogResourcePolicy", new Aws.CloudWatch.LogResourcePolicyArgs
        {
            PolicyDocument = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Effect"": ""Allow"",
      ""Principal"": {
        ""Service"": ""es.amazonaws.com""
      },
      ""Action"": [
        ""logs:PutLogEvents"",
        ""logs:PutLogEventsBatch"",
        ""logs:CreateLogStream""
      ],
      ""Resource"": ""arn:aws:logs:*""
    }
  ]
}

",
            PolicyName     = "example",
        });
        var exampleDomain = new Aws.ElasticSearch.Domain("exampleDomain", new Aws.ElasticSearch.DomainArgs
        {
            LogPublishingOptions =
            {
                new Aws.ElasticSearch.Inputs.DomainLogPublishingOptionArgs
                {
                    CloudwatchLogGroupArn = exampleLogGroup.Arn,
                    LogType = "INDEX_SLOW_LOGS",
                },
            },
        });
    }