1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

TerraformのIDプロバイダのimportでexpected "url" to have a hostが出る

Posted at

概要

以下のterraformのimportブロックを書く

resource "aws_iam_openid_connect_provider" "github_actions_cicd_provider" {
  client_id_list  = ["sts.amazonaws.com"]
  tags            = {}
  tags_all        = {}
  thumbprint_list = ["1b511abead59c6ce207077c0bf0e0043b1382612"]
  url             = "token.actions.githubusercontent.com"
}

import {
  to = aws_iam_openid_connect_provider.github_actions_cicd_provider
  id = "arn:aws:iam::${var.AWS_ACCOUNT_ID}:oidc-provider/token.actions.githubusercontent.com"
}

するとIDプロバイダのimportで次のエラーが発生する場合があります。

Error: expected "url" to have a host, got token.actions.githubusercontent.com
│  ...
│  445:   url = "token.actions.githubusercontent.com"

解決策

このエラーを解決するために、URLに https:// を追加します。

resource "aws_iam_openid_connect_provider" "github_actions_cicd_provider" {
  client_id_list  = ["sts.amazonaws.com"]
  tags            = {}
  tags_all        = {}
  thumbprint_list = ["1b511abead59c6ce207077c0bf0e0043b1382612"]
  url             = "https://token.actions.githubusercontent.com"
}

参考

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?