LoginSignup
2
3

More than 5 years have passed since last update.

【Terraform】インスタンスが作成できない。(Error launching source instance: OptInRequire)

Posted at

エラー

main.tfを作成して、terraform applyをしたら、下記エラーが出ました。
AWSのコンソールで確認すると、EC2インスタンスのみ作成されていないようでした。
→セキュリティグループやVPCなど、インスタンスに依存しない部分は作成されていました。

Error applying plan:

1 error(s) occurred:

* aws_instance.TestEC2: 1 error(s) occurred:

* aws_instance.TestEC2: Error launching source instance: OptInRequired: In order to use this AWS Marketplace product you need to accept terms and subscribe. To do so please visit http://aws.amazon.com/marketplace/pp?sku=aw0evgkw8e5c1q413zgy5pjce
    status code: 401, request id: 845acf0d-7dec-4ebd-b4b4-a4771f04ea16

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

解決方法

AWS Marketplaceで認証を許可してから、再度terraform applyを実行!

1.まずは、エラーに書いてあったWebページに移動し、[continue]を押下します。

To do so please visit http://aws.amazon.com/marketplace/pp?sku=aw0evgkw8e5c1q413zgy5pjce

スクリーンショット 2017-10-29 14.00.19.png

2.[Manual Launch]を選択し、[Accept Software Terms]を押下します。

スクリーンショット 2017-10-29 14.04.39.png

3.下記画面が出たら成功です!

スクリーンショット 2017-10-29 14.04.46.png

再度terraform applyして、問題なければ完了!

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3