1. Docs
  2. Clouds
  3. AWS
  4. AWS Guides
  5. Creating an AWS Athena Data Service with Pulumi

Creating an AWS Athena Data Service with Pulumi

    Create an AWS Athena resource using @pulumi/aws

    The @pulumi/aws library enables fine-grained control over the AWS Athena resource meaning it can be coded, deployed, and managed entirely in code.

    const aws = require("@pulumi/aws");
    
    const databaseBucket = new aws.s3.Bucket("mydatabasebucket");
    
    const database = new aws.athena.Database("mydatabase", {
        name: "mydatabase",
        bucket: databaseBucket.bucket
    });
    
    const namedQuery = new aws.athena.NamedQuery("mynamedquery", {
        database: database.id,
        query: database.id.apply(n => `SELECT * FROM ${n} limit 10;`)
    });
    
      Pulumi AI - What cloud infrastructure would you like to build? Generate Program