Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Artifact Registry #46

Merged
merged 6 commits into from
May 6, 2024
Merged

Use Artifact Registry #46

merged 6 commits into from
May 6, 2024

Conversation

raahii
Copy link
Contributor

@raahii raahii commented May 6, 2024

Changes

container registry から artifact registry に移行する。
functionも2nd genに移行したほうが良いがこのPRではやらない。

resolve #34

Ref

Container Registry からの移行  |  Artifact Registry のドキュメント  |  Google Cloud

@raahii raahii self-assigned this May 6, 2024
Copy link

github-actions bot commented May 6, 2024

Terraform Initialization ⚙️success

Terraform Plan 📖success

Terraform Validation 🤖success

Show Plan
data.archive_file.bot: Reading...
data.archive_file.bot: Read complete after 1s [id=ec04e56dc78b695b4882097fe12f6e02858139b9]
data.google_secret_manager_secret_version.line_bot_channel_secret: Reading...
data.google_secret_manager_secret_version.line_bot_channel_access_token: Reading...
google_storage_bucket.bucket: Refreshing state... [id=haraiai-bucket]
google_storage_bucket_object.bot: Refreshing state... [id=haraiai-bucket-func/bot.75ee0babf5fc31b0bf74e47b84fe5f7f.zip]
data.google_secret_manager_secret_version.line_bot_channel_secret: Read complete after 0s [id=projects/900543910035/secrets/lineBotChannelSecret/versions/1]
data.google_secret_manager_secret_version.line_bot_channel_access_token: Read complete after 0s [id=projects/900543910035/secrets/lineBotChannelAccessToken/versions/1]
google_cloudfunctions_function.bot_webhook: Refreshing state... [id=projects/haraiai/locations/asia-northeast1/functions/BotWebhookHandler]
google_cloudfunctions_function_iam_member.webhook_invoker: Refreshing state... [id=projects/haraiai/locations/asia-northeast1/functions/BotWebhookHandler/roles/cloudfunctions.invoker/allUsers]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # google_artifact_registry_repository.repo will be created
  + resource "google_artifact_registry_repository" "repo" {
      + create_time      = (known after apply)
      + effective_labels = (known after apply)
      + format           = "DOCKER"
      + id               = (known after apply)
      + location         = (known after apply)
      + mode             = "STANDARD_REPOSITORY"
      + name             = (known after apply)
      + project          = "haraiai"
      + repository_id    = "haraiai"
      + terraform_labels = (known after apply)
      + update_time      = (known after apply)
    }

  # google_cloudfunctions_function.bot_webhook will be updated in-place
  ~ resource "google_cloudfunctions_function" "bot_webhook" {
      + docker_repository            = (known after apply)
        id                           = "projects/haraiai/locations/asia-northeast1/functions/BotWebhookHandler"
        name                         = "BotWebhookHandler"
      ~ source_archive_object        = "func/bot.83b71829bd57152cb18305c0103e482d.zip" -> "func/bot.75ee0babf5fc31b0bf74e47b84fe5f7f.zip"
        # (22 unchanged attributes hidden)
    }

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

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Pushed by: @raahii, Action: pull_request

Copy link

cloudflare-workers-and-pages bot commented May 6, 2024

Deploying haraiai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4bdc166
Status:⚡️  Build in progress...

View logs

@pocket-dan pocket-dan deleted a comment from github-actions bot May 6, 2024
@pocket-dan pocket-dan deleted a comment from github-actions bot May 6, 2024

google = {
source = "hashicorp/google"
version = "5.27.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google providerのバージョン指定をしていなかった。
最新バージョンにすることで、docker_registry が指定できるようになり、デフォルトで ARTIFACT_REGISTRY が使用される。
https://registry.terraform.io/providers/hashicorp/google/5.27.0/docs/resources/cloudfunctions2_function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

custom registryを指定しない場合、asia.gcr.io/haraiai 以下に勝手に作られている。良さそう
https://console.cloud.google.com/artifacts/docker/haraiai/asia/asia.gcr.io?authuser=1&project=haraiai

@pocket-dan pocket-dan deleted a comment from github-actions bot May 6, 2024
@raahii raahii merged commit f6b4219 into main May 6, 2024
4 of 5 checks passed
@raahii raahii deleted the artifact-registry branch May 6, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Artifact Registry APIの有効化とImage Registryの指定
1 participant