정리
This commit is contained in:
11
modules/ec2/eks-host.sh
Normal file
11
modules/ec2/eks-host.sh
Normal file
@ -0,0 +1,11 @@
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
source ~/.bash_profile
|
||||
curl -o /usr/local/bin/kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.23.13/2022-10-31/bin/linux/amd64/kubectl
|
||||
chmod +x /usr/local/bin/kubectl
|
||||
yum install -y jq
|
||||
yum install -y bash-completion
|
||||
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
|
||||
mv -v /tmp/eksctl /usr/local/bin
|
@ -7,11 +7,13 @@ resource "aws_network_interface" "eni" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_instance" "ubuntu" {
|
||||
resource "aws_instance" "ec2" {
|
||||
ami = var.ami_name
|
||||
# "ami-0ab04b3ccbadfae1f"
|
||||
instance_type = var.instance_type
|
||||
# "t2.micro"
|
||||
|
||||
# user_data = var.user_data
|
||||
|
||||
tags = {
|
||||
Name = "${var.tag_name}"
|
||||
|
9
modules/ec2/mariadb.sh
Normal file
9
modules/ec2/mariadb.sh
Normal file
@ -0,0 +1,9 @@
|
||||
cat <<EOF>> /etc/yum.repos.d/MariaDB.repo
|
||||
[mariadb]
|
||||
name = MariaDB
|
||||
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
|
||||
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
||||
gpgcheck = 1
|
||||
EOF
|
||||
yum install mariadb-server -y
|
||||
systemctl enable --now mariadb
|
3
modules/ec2/nginx.sh
Normal file
3
modules/ec2/nginx.sh
Normal file
@ -0,0 +1,3 @@
|
||||
yum update -y
|
||||
amazon-linux-extras install -y nginx1
|
||||
systemctl enable --now nginx
|
@ -1,10 +1,10 @@
|
||||
output "ec2_id" {
|
||||
value = aws_instance.ubuntu.id
|
||||
value = aws_instance.ec2.id
|
||||
|
||||
}
|
||||
|
||||
output "public_ip_associate" {
|
||||
value = aws_instance.ubuntu.associate_public_ip_address
|
||||
value = aws_instance.ec2.associate_public_ip_address
|
||||
|
||||
}
|
||||
|
||||
|
@ -33,4 +33,5 @@ variable "sg_list" {
|
||||
description = "sg list"
|
||||
type = list(string)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user