示例#1
0
 public MyStack()
 {
     var example = new Aws.Athena.Workgroup("example", new Aws.Athena.WorkgroupArgs
     {
         Configuration = new Aws.Athena.Inputs.WorkgroupConfigurationArgs
         {
             EnforceWorkgroupConfiguration   = true,
             PublishCloudwatchMetricsEnabled = true,
             ResultConfiguration             = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationArgs
             {
                 EncryptionConfiguration = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs
                 {
                     EncryptionOption = "SSE_KMS",
                     KmsKeyArn        = aws_kms_key.Example.Arn,
                 },
                 OutputLocation = "s3://{aws_s3_bucket.example.bucket}/output/",
             },
         },
     });
 }
示例#2
0
 public MyStack()
 {
     var hogeBucket = new Aws.S3.Bucket("hogeBucket", new Aws.S3.BucketArgs
     {
     });
     var testKey = new Aws.Kms.Key("testKey", new Aws.Kms.KeyArgs
     {
         DeletionWindowInDays = 7,
         Description          = "Athena KMS Key",
     });
     var testWorkgroup = new Aws.Athena.Workgroup("testWorkgroup", new Aws.Athena.WorkgroupArgs
     {
         Configuration = new Aws.Athena.Inputs.WorkgroupConfigurationArgs
         {
             ResultConfiguration = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationArgs
             {
                 EncryptionConfiguration = new Aws.Athena.Inputs.WorkgroupConfigurationResultConfigurationEncryptionConfigurationArgs
                 {
                     EncryptionOption = "SSE_KMS",
                     KmsKeyArn        = testKey.Arn,
                 },
             },
         },
     });
     var hogeDatabase = new Aws.Athena.Database("hogeDatabase", new Aws.Athena.DatabaseArgs
     {
         Bucket = hogeBucket.Id,
         Name   = "users",
     });
     var foo = new Aws.Athena.NamedQuery("foo", new Aws.Athena.NamedQueryArgs
     {
         Database  = hogeDatabase.Name,
         Query     = hogeDatabase.Name.Apply(name => $"SELECT * FROM {name} limit 10;"),
         Workgroup = testWorkgroup.Id,
     });
 }