Atlantis for Terraform Automation with Azure multi-subscription

Atlantis for Terraform Automation with Azure multi-subscription

1.Make Azure Service Principal with Multi-Subscription

az ad sp create-for-rbac -n "xxx" --role Owner --scopes /subscriptions/xxx-xxx-xxx-xxx-xxx /subscriptions/xxx-xxx-xxx-xxx-xxx

2.Dockerfile command

FROM ghcr.io/runatlantis/atlantis:latest
ENV ARM_CLIENT_ID=xxx
ENV ARM_CLIENT_SECRET=xxx
ENV ARM_TENANT_ID=xxx
ENV ARM_SUBSCRIPTION_ID=xxx

RUN apk add py3-pip
RUN apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo make
RUN pip install --upgrade pip
RUN pip install azure-cli

RUN az login --service-principal -u xxx -p xxx --tenant xxx

3.'backend.tf' with each azure subsctiption

terraform {
  backend "azurerm" {
    container_name       = "xxx"
    key                  = "xxx"
    resource_group_name  = "xxx"
    storage_account_name = "xxx"
    subscription_id      = "xxx"
  }
}

4.Reference

Terraform Pull Request Automation | Atlantis
Atlantis: Terraform Pull Request Automation
Terragrunt | Terraform wrapper
Terragrunt is a thin wrapper for Terraform that provides extra tools for keeping your Terraform configurations DRY, working with multiple Terraform modules, and managing remote state.
Create Azure service principals using the Azure CLI
Learn how to create and use service principals to control access to Azure resources using the Azure CLI.

Read more

[React Native] WebView 안드로이드 로그인 유지

증상 * 안드로이드 앱에서 로그인 유지가 의도한 것 보다 짧게 유지 되거나 로그인 정보가 날라가는 오류가 있었습니다 원인 * 로그인 인증을 위한 쿠키가 메모리에서 디스크로 이동하는데 일정 간격이 있어서 실시간으로 동기화 되지 않았기 때문입니다 조치 * 안드로이드에서 쿠키를 디스크(영구 저장소)로 저장하는 메소드를 앱이 백그라운드로 이동할 때 호출하여 해결하였습니다 * React native의 쿠키관리

By Taehwan Go