퍼블릭 클라우드 썸네일형 리스트형 AWS 교차 계정 접근(Cross-Account Access)을 설정하는 방법 AWS 교차 계정 접근(Cross-Account Access)을 설정하는 방법 1. 새로운 역할(role) 구성 AWS 관리 콘솔 > IAM > 역할 > 역할만들기 정책: AdministratorAccess 역할 이름: SwitchRole 역할 설명: Switch Role 2. 정책 생성 AWS 관리 콘솔 > IAM > 정책> 정책 생성 정책: STS:AssumeRole 이름: STSPolicy 설명: STS Policy 3. 사용자에 정책 할당 AWS 관리 콘솔 > IAM > 사용자 > user > 요약 > 권한 추가 4. 사용자(user) 재로그인 후 역할 전환 5. 역할 전환 확인 AWS 교차 계정 접근을 설정하면 보안 및 권한 관리를 효과적으로 제어하고 다른 AWS 계정과 리소스 간의 협업을 가능.. 더보기 [Terraform] 테라폼 모듈화 테스트 테라폼(terraform) 모듈화 테스트 루트 모듈에서 VPC 구성 main.tf 파일 $ vim main.tf module "vpc" { source = "../../../tfmodules/vpc/" aws_region = "ap-northeast-2" suffix = "11" tf_env = "test" #tf_domain = "test.tf.4wxyz.com" public-cidr = ["10.11.12.0/23", "10.11.16.0/23"] private-cidr = ["10.11.22.0/24", "10.11.26.0/24"] mgmt-cidr = ["10.11.92.0/24", "10.11.96.0/24"] azs = ["ap-northeast-2a", "ap-northeast-2c"] }.. 더보기 [ping] Pingcloud-cli 툴 Pingcloud-cli 툴 $ git clone https://github.com/reoim/pingcloud-cli.git $ cd pingcloud-cli $ pingcloud-cli aws $ pingcloud-cli aws us-east-1 https://github.com/reoim/pingcloud-cli.git reoim/pingcloud-cli CLI application to check http request latency of AWS, Google Cloud Platform and Azure - reoim/pingcloud-cli github.com 웹 브라우저에서 통한 latency 체크 https://www.cloudping.co/grid https://github.com/mda5.. 더보기 [Terraform] 테라폼 모듈화 테스트 테라폼 모듈화 테스트 디렉토리 구조 . ├── main.tf ├── modules │ ├── EC2 │ │ ├── main.tf │ │ └── script │ │ └── install_web1.sh │ ├── RDS │ └── VPC ├── provider.tf └── variables.tf 루트 모듈 provider.tf $ vim provider.tf ### ./provider.tf terraform { required_providers { aws = { source = "hashicorp/aws" version = "3.25.0" } } } provider "aws" { # Configuration options shared_credentials_file = "~/.aws/credentials" r.. 더보기 [Terraform] 테라폼 키 페어 생성 키 페어 생성 key.tf 파일 생성 $ vim key.tf ###keypair 생성 resource "aws_key_pair" "tf_key_4wxyz" { key_name = "4wxyz" public_key = file("~/aws-key-pair/4wxyz.pub") tags = { Name = "4wxyz" Env = "stg" CreateUser = "terraform@email.com" Owner = "iac" Role = "keypair" Service = "keypair" } } 더보기 [Terraform] 테라폼 보안 그룹에 정책 추가 보안 그룹에 정책 추가 - EC2 보안 그룹에 ALB 정책 추가 ec2-sg.tf $ vim ec2-sg.tf ####################EC2 웹 시큐리티 구룹 생성 resource "aws_security_group" "tf_vpc99_sg-ec2-web1" { name = "ec2-web1" description = "Managed In Terraform" vpc_id = aws_vpc.tf_vpc99.id tags = { Name = "ec2-web1" Env = "stg" CreateUser = "terraform@email.com" Owner = "iac" Role = "security_group" Service = "security" } ingress { description = ".. 더보기 [Terraform] 테라폼 ALB(로드밸런서) 생성 ALB(로드밸런서) 생성 (선행 작업) - Route 53 생성 - SSL 인증서 생성 - security group 생성 - 인스턴스 생성 - ./script/install_web1.sh 스크립트 생성 alb.tf 파일 생성 $ vim alb.tf ####################ALB 생성 resource "aws_alb" "tf_alb-web1" { name = "web1" internal = false load_balancer_type = "application" idle_timeout = 60 security_groups = [ aws_security_group.tf_vpc99_sg_alb-web1.id ] subnets = [ aws_subnet.tf_vpc99-sb11.id, aws_su.. 더보기 [Terraform] 테라폼 ec2 인스턴스 생성 ec2 인스턴스 생성 (선행 작업) - key pair 생성 - security group 생성 - ./script/install_web1.sh 스크립트 생성 instance.tf 파일 생성 $ vim instance.tf resource "aws_instance" "web31" { ami = "ami-047a51fa27710816e" instance_type = "t2.micro" #ebs_optimized = true #monitoring = true #count = 1 key_name = aws_key_pair.aws_key_4wxyz.key_name associate_public_ip_address = true # subnet_id = aws_subnet.sangchul_vpc11-sb3.id v.. 더보기 이전 1 ··· 19 20 21 22 23 24 25 ··· 27 다음