티스토리 뷰

테라폼을 이용해서 오픈스택 리소스를 생성할 때 인증을 받는 방법은 여러가지가 있습니다. 키스톤에서 제공하는 인증을 설정 값에 추가하면 여러가지 인증을 이용할 수 있습니다. 그 중에서 아이디/암호, 크레덴셜 ID/시크릿, 토큰을 이용하는 방법은 오픈스택 rc 파일에 설정을 통해서 진행할 수 있습니다.

 

  • 아이디/암호
    • OS_AUTH_TYPE=v3password
    • OS_USERNAME=username
    • OS_PASSWORD=password
  • 크레덴셜ID/시크릿
    • OS_AUTH_TYPE=v3applicationcredential
    • OS_APPLICATION_CREDENTIAL_ID=xxxxxxxxxxx
    • OS_APPLICATION_CREDENTIAL_SECRET=xxxxxxxxxx
  • 토큰
    • OS_AUTH_TYPE=v3token
    • OS_TOKEN=ggggggg

 

애플리케이션 크레덴셜 예제

# COMMON OPENSTACK ENVS
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3
export OS_COMPUTE_API_VERSION=2.26
export OS_NO_CACHE=1
export OS_AUTH_URL=https://identity.openstack.com/v3
export OS_AUTH_VERSION=3
export OS_AUTH_TYPE=v3applicationcredential
export OS_APPLICATION_CREDENTIAL_ID=AAAAAAAAAA
export OS_APPLICATION_CREDENTIAL_SECRET=BBBBBBBBBB
view raw openrc.sh hosted with ❤ by GitHub
terraform {
required_version = ">= 0.14.0" # Takes into account Terraform versions from 0.14.0
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.43.0"
}
}
}
provider "openstack" {
auth_url = "https://identity.openstack.com/v3"
}
resource "openstack_compute_instance_v2" "test-server" {
# ...
}
view raw openstack-rc.tf hosted with ❤ by GitHub

 

토큰

# COMMON OPENSTACK ENVS
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3
export OS_COMPUTE_API_VERSION=2.26
export OS_NO_CACHE=1
export OS_AUTH_URL=https://identity.openstack.com/v3
export OS_AUTH_VERSION=3
export OS_AUTH_TYPE=v3token
view raw openrc.sh hosted with ❤ by GitHub
terraform {
required_version = ">= 0.14.0" # Takes into account Terraform versions from 0.14.0
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.43.0"
}
}
}
provider "openstack" {
allow_reauth = false
token = "xxxxxxxxxxxx"
}
resource "openstack_compute_instance_v2" "test-server" {
# ...
}
view raw openstack-rc.tf hosted with ❤ by GitHub

 

참고

키스톤 인증 방식 플러그인

https://docs.openstack.org/keystoneauth/latest/plugin-options.html#available-plugins

 

Plugin Options — keystoneauth1 4.4.1.dev1 documentation

this page last updated: 2017-01-10 22:56:46

docs.openstack.org

 

테라폼 오픈스택 프로바이더

https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs

 

Terraform Registry

 

registry.terraform.io

 

반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함