热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ErrorCreatingAthenaDatabase

TerraformVersionTerraform0.11.3aws1.14.0AffectedResource(s)


Terraform Version

Terraform 0.11.3
aws 1.14.0

Affected Resource(s)

Please list the resources as a list, for example:
- aws_athena_database

Terraform Configuration Files

1
2
3
4
5
6
hcl

resource "aws_athena_database" "pccp_datalake" {

  name          = "PccpDevDatalake"

  bucket        = "${aws_s3_bucket.pccp_datalake.bucket}"

  force_destroy = true

}


Debug Output

https://gist.github.com/andrewmichael/4d1b1e5bf035b1e35264cd81111723c0

Expected Behavior

Athena database is created, and subsequent plan / apply commands operate correctly.

Actual Behavior

Plan output:-

1
2
3
4
5
6
7
8
9
10
11
Terraform will perform the following actions:



  + aws_athena_database.pccp_datalake

      id:            

      bucket:        "pccp-dev-datalake"

      force_destroy: "true"

      name:          "PccpDevDatalake"





Plan: 1 to add, 0 to change, 0 to destroy.


Apply end in error:-

1
2
3
4
5
6
7
8
Error: Error applying plan:



1 error(s) occurred:



* aws_athena_database.pccp_datalake: 1 error(s) occurred:



* aws_athena_database.pccp_datalake: [ERROR] Athena not found database: PccpDevDatalake, query result: default

pccpdevdatalake

Subsequent plan / apply fails.

1
2
3
4
5
6
Error: Error refreshing state: 1 error(s) occurred:



* aws_athena_database.pccp_datalake: 1 error(s) occurred:



* aws_athena_database.pccp_datalake: aws_athena_database.pccp_datalake: [ERROR] Athena not found database: PccpDevDatalake, query result: default

pccpdevdatalake

Observing the AWS console the database appears to have been created.
The only way out of this now is to manually deleting the Athena database, then revert to the previous version of remote state in S3.

Just reverting remote state, results in the following error:-

1
2
3
4
5
6
7
Error: Error applying plan:



1 error(s) occurred:



* aws_athena_database.pccp_datalake: 1 error(s) occurred:



* aws_athena_database.pccp_datalake: reason: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Database PccpDevDatalake already exists


Steps to Reproduce

Please list the steps required to reproduce the issue, for example:
1.

1
terraform plan

1.

1
terraform apply

Important Factoids

IAM user has admin permissions
remote state is persisted in s3

该提问来源于开源项目:hashicorp/terraform-provider-aws

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!


推荐阅读
author-avatar
涛涛哈帅_365
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有