如何使用Cloudformation更新Athena输出位置 [英] How to update Athena output location using Cloudformation

查看:134
本文介绍了如何使用Cloudformation更新Athena输出位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我写一个云形成脚本来更新Athena主要工作组的输出位置吗?当我运行以下代码时,收到错误消息提供了无效的请求:无法创建主工作组(服务:雅典娜,状态代码:400,请求ID:9945209c-6999-4e8b-bd3d-a3af13b4ac4f​​)"

Can someone help me write a Cloud formation script to update output location of Athena primary workgroup. When i run below code, getting error message "Invalid request provided: primary workGroup could not be created (Service: Athena, Status Code: 400, Request ID: 9945209c-6999-4e8b-bd3d-a3af13b4ac4f)"

Resources:
  MyAthenaWorkGroup:
    Type: AWS::Athena::WorkGroup
    Properties:
      Name: primary
      Description: My WorkGroup Updated
      State: DISABLED
      WorkGroupConfigurationUpdates:
        BytesScannedCutoffPerQuery: 10000000
        EnforceWorkGroupConfiguration: true
        PublishCloudWatchMetricsEnabled: true
        RequesterPaysEnabled: false
        ResultConfigurationUpdates:
          EncryptionConfiguration:
            EncryptionOption: SSE_S3          
          OutputLocation: s3://test/

推荐答案

您需要创建更改集以将现有资源导入到新堆栈或现有堆栈中.",因为主要"工作组是在堆栈外部创建的. 因此,您需要使用以下选项:使用现有资源创建堆栈":

you need to "create a change set to import an existing resource into a new or existing stack.", because the 'primary' workgroup was created outside your stack. So you need to use the option: "Create stack with existing resources":

您还需要添加DeletionPolicy/UpdateReplacePolicy. 一个完整的工作示例是:

You also need to add DeletionPolicy/UpdateReplacePolicy. An complete working example is:

  Resources:
    AthenaPrimaryWorkGroup:
      Type: AWS::Athena::WorkGroup
      Properties:
        Name: primary
        State: ENABLED
        WorkGroupConfigurationUpdates:
          BytesScannedCutoffPerQuery: 1000000000
          EnforceWorkGroupConfiguration: true
          PublishCloudWatchMetricsEnabled: true
          RequesterPaysEnabled: false
          ResultConfigurationUpdates:
            OutputLocation: s3://MY-Athena-results
      DeletionPolicy: Retain
      UpdateReplacePolicy: Retain

更多详细信息,请访问: https://docs.aws .amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html

More detail at: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html

这篇关于如何使用Cloudformation更新Athena输出位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆