Class NamedQuery
Provides an Athena Named Query resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Athena
Assembly: Pulumi.Aws.dll
Syntax
public class NamedQuery : CustomResource
Constructors
View SourceNamedQuery(String, NamedQueryArgs, CustomResourceOptions)
Create a NamedQuery resource with the given unique name, arguments, and options.
Declaration
public NamedQuery(string name, NamedQueryArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| NamedQueryArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDatabase
The database to which the query belongs.
Declaration
public Output<string> Database { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A brief explanation of the query. Maximum length of 1024.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The plain language name for the query. Maximum length of 128.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Query
The text of the query itself. In other words, all query statements. Maximum length of 262144.
Declaration
public Output<string> Query { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Workgroup
The workgroup to which the query belongs. Defaults to primary
Declaration
public Output<string> Workgroup { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, NamedQueryState, CustomResourceOptions)
Get an existing NamedQuery resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static NamedQuery Get(string name, Input<string> id, NamedQueryState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| NamedQueryState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| NamedQuery |