Java ???? AWS ECS? Spring Boot API? ???? ??? ??? ? ?? ??? CDKTF(Cloud Development Kit for Terraform) ????? ?? ????? ??? ? ?? ??? ???? ??????.
?? ????? Python? ?? ?? ????? ??? ???? IaC(Infrastructure as Code)? ??? ? ?? ?????? CDKTF? ??????. ? ??? CDKTF? ? ?? GA ???? ????? ??? ?? ????? ??? ?????. ? ????? CDKTF? ???? AWS ECS? Spring Boot API? ???? ??? ?????.
? Github ????? ? ??? ??? ?????.
???? ??
??? ?? ??? ???? ?? ????? ????? ??? ?????.
? ??????? ????? 3?? ???? ?? ? ????.
-
????:
- VPC
- ??? ? ???? ???
- ??? ?????
- NAT ?????
-
???:
- ?????? ?? ???(ALB)
- ???
- ECS ????
-
??? ??:
- ????
- ECS ???
- ?? ??
1??: Spring Boot ?????? ?????
??? ?? ?? Java API? GitHub?? ??? ? ????.
3?? ?????? ?? ??? REST API? ?????.
- /ping: "pong" ???? ?????. ? ?????? API? ???? ????? ? ?????. ?? ????? ?? Prometheus ??? ????? ??????.
- /healthcheck: "ok"? ???? ??????? ???? ???? ??? ???? ?? ?? ?? ????? ??? ???. /ping? ????? ?? ???? ?? Prometheus ???? ???????.
- /hello: ?? ?? ????(???? "World")? ???? ?? ???(?: "Hello, [name]!")? ?????. ? ?????? Prometheus ????? ?????.
Dockerfile? ??? ?????.
FROM maven:3.9-amazoncorretto-21 AS builder WORKDIR /app COPY pom.xml . COPY src src RUN mvn clean package # amazon java distribution FROM amazoncorretto:21-alpine COPY --from=builder /app/target/*.jar /app/java-api.jar EXPOSE 8080 ENTRYPOINT ["java","-jar","/app/java-api.jar"]
??????? ??? ??? ?????!
2??: AWS CDKTF ??
AWS CDKTF? ???? Python? ???? AWS ???? ???? ??? ? ????.
1. ????
- [**python (3.13)**](https://www.python.org/) - [**pipenv**](https://pipenv.pypa.io/en/latest/) - [**npm**](https://nodejs.org/en/)
2. CDKTF ? ??? ??
CDKTF ? ?? ?? ??? ???? ??? ??? ??? ?????.
$ npm install -g cdktf-cli@latest
??? ?? ??? ??? ?? ? ????? ??? ? ?? cdktf CLI? ?????.
3. CDKTF ?????? ???
??? ???? ??? Python ????? ????? ? ????.
FROM maven:3.9-amazoncorretto-21 AS builder WORKDIR /app COPY pom.xml . COPY src src RUN mvn clean package # amazon java distribution FROM amazoncorretto:21-alpine COPY --from=builder /app/target/*.jar /app/java-api.jar EXPOSE 8080 ENTRYPOINT ["java","-jar","/app/java-api.jar"]
3 ?? : ?? ?
- [**python (3.13)**](https://www.python.org/) - [**pipenv**](https://pipenv.pypa.io/en/latest/) - [**npm**](https://nodejs.org/en/)? Terraform (CDKTF)? CDK? ??? TerraForm ???? ????? ??? ??? ??? ?????. ??? ?? ???? ?? ?? ??? ?? ??? ?? ??? ???????. ?? ?? ???? ????? ??? ?? ??? ?????.
1.
<_> ????? Network_stack.py ??? ? ??????
?? ???? ???? ????? ?? ??? ??????.
?? ?? ??? ??????
?? ??? ???? Terraform ?? ??? ?????.
???? ??? ? ??????
$ npm install -g cdktf-cli@latest
# init the project using aws provider $ mkdir samples-fargate $ cd samples-fargate && cdktf init --template=python --providers=aws
2.
infra_stack.py ??? ??????
#!/usr/bin/env python from constructs import Construct from cdktf import App, TerraformStack class MyStack(TerraformStack): def __init__(self, scope: Construct, id: str): super().__init__(scope, id) # define resources here app = App() MyStack(app, "aws-cdktf-samples-fargate") app.synth()
?? ??? ???? ???? ?? ?? ??? ??????.
<p>
<br>
??? ?????? :
</p>
<pre class="brush:php;toolbar:false">$ mkdir infra
$ cd infra && touch network_stack.py
</pre>
<p>
<inf> ? ??????
<br>
<n> alb? DNS ??? ??????.
</n></inf></p> <pre class="brush:php;toolbar:false">from constructs import Construct
from cdktf import S3Backend, TerraformStack
from cdktf_cdktf_provider_aws.provider import AwsProvider
from cdktf_cdktf_provider_aws.vpc import Vpc
from cdktf_cdktf_provider_aws.subnet import Subnet
from cdktf_cdktf_provider_aws.eip import Eip
from cdktf_cdktf_provider_aws.nat_gateway import NatGateway
from cdktf_cdktf_provider_aws.route import Route
from cdktf_cdktf_provider_aws.route_table import RouteTable
from cdktf_cdktf_provider_aws.route_table_association import RouteTableAssociation
from cdktf_cdktf_provider_aws.internet_gateway import InternetGateway
class NetworkStack(TerraformStack):
def __init__(self, scope: Construct, ns: str, params: dict):
super().__init__(scope, ns)
self.region = params["region"]
# configure the AWS provider to use the us-east-1 region
AwsProvider(self, "AWS", region=self.region)
# use S3 as backend
S3Backend(
self,
bucket=params["backend_bucket"],
key=params["backend_key_prefix"] + "/network.tfstate",
region=self.region,
)
# create the vpc
vpc_demo = Vpc(self, "vpc-demo", cidr_block="192.168.0.0/16")
# create two public subnets
public_subnet1 = Subnet(
self,
"public-subnet-1",
vpc_id=vpc_demo.id,
availability_zone=f"{self.region}a",
cidr_block="192.168.1.0/24",
)
public_subnet2 = Subnet(
self,
"public-subnet-2",
vpc_id=vpc_demo.id,
availability_zone=f"{self.region}b",
cidr_block="192.168.2.0/24",
)
# create. the internet gateway
igw = InternetGateway(self, "igw", vpc_id=vpc_demo.id)
# create the public route table
public_rt = Route(
self,
"public-rt",
route_table_id=vpc_demo.main_route_table_id,
destination_cidr_block="0.0.0.0/0",
gateway_id=igw.id,
)
# create the private subnets
private_subnet1 = Subnet(
self,
"private-subnet-1",
vpc_id=vpc_demo.id,
availability_zone=f"{self.region}a",
cidr_block="192.168.10.0/24",
)
private_subnet2 = Subnet(
self,
"private-subnet-2",
vpc_id=vpc_demo.id,
availability_zone=f"{self.region}b",
cidr_block="192.168.20.0/24",
)
# create the Elastic IPs
eip1 = Eip(self, "nat-eip-1", depends_on=[igw])
eip2 = Eip(self, "nat-eip-2", depends_on=[igw])
# create the NAT Gateways
private_nat_gw1 = NatGateway(
self,
"private-nat-1",
subnet_id=public_subnet1.id,
allocation_id=eip1.id,
)
private_nat_gw2 = NatGateway(
self,
"private-nat-2",
subnet_id=public_subnet2.id,
allocation_id=eip2.id,
)
# create Route Tables
private_rt1 = RouteTable(self, "private-rt1", vpc_id=vpc_demo.id)
private_rt2 = RouteTable(self, "private-rt2", vpc_id=vpc_demo.id)
# add default routes to tables
Route(
self,
"private-rt1-default-route",
route_table_id=private_rt1.id,
destination_cidr_block="0.0.0.0/0",
nat_gateway_id=private_nat_gw1.id,
)
Route(
self,
"private-rt2-default-route",
route_table_id=private_rt2.id,
destination_cidr_block="0.0.0.0/0",
nat_gateway_id=private_nat_gw2.id,
)
# associate routes with subnets
RouteTableAssociation(
self,
"public-rt-association",
subnet_id=private_subnet2.id,
route_table_id=private_rt2.id,
)
RouteTableAssociation(
self,
"private-rt1-association",
subnet_id=private_subnet1.id,
route_table_id=private_rt1.id,
)
RouteTableAssociation(
self,
"private-rt2-association",
subnet_id=private_subnet2.id,
route_table_id=private_rt2.id,
)
# terraform outputs
self.vpc_id = vpc_demo.id
self.public_subnets = [public_subnet1.id, public_subnet2.id]
self.private_subnets = [private_subnet1.id, private_subnet2.id]
</pre>
<p>
3. <service> ??? ??
<img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173768468278252.png" class="lazy" alt="Network Deployment" loading="lazy" style="max-width:90%" style="max-width:90%">
</service></p> ???? ? service_stack.py <lo> ??? ??????
<p>
</p>
<code> ?? ECS ??? ???? ????? ?? ??? ??????.
<p>
<img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173768468369073.png" class="lazy" alt="Network Map" loading="lazy" style="max-width:90%" style="max-width:90%">
<..> main.py? ???????? (??????) :
</..></p>
<h3>
??? ?? ? ??????
</h3>
?? ??? ??!
<created> ??? AWS ECS Fargate? ??? ???? ???? ?? ?? ???? ????? ??????.
<to> ?? ??? ???? ??? ??????.
<p>
<strong>
</strong> <br></p>
<h2>
4??: Github ?? ????
</h2>
<p>??? ????? ?? GitHub Actions ????? <strong>java-api</strong>? ??? ?????. Github Actions? ????? ???? ??? ??? ??? ? .github/workflows/deploy.yml ??? ???? ?? ???? ?????.<br>
</p>
<pre class="brush:php;toolbar:false">FROM maven:3.9-amazoncorretto-21 AS builder
WORKDIR /app
COPY pom.xml .
COPY src src
RUN mvn clean package
# amazon java distribution
FROM amazoncorretto:21-alpine
COPY --from=builder /app/target/*.jar /app/java-api.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app/java-api.jar"]
</pre>
<p>????? ? ???? ????.</p>
<p><img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173768468718392.png" class="lazy" alt="Github Actions" loading="lazy" style="max-width:90%" style="max-width:90%"></p>
<p>?? ???? ?? ???? ????? ???????.</p>
<p><img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/173768468825982.png" class="lazy" alt="ECS Service" loading="lazy" style="max-width:90%" style="max-width:90%"></p>
<h2>
5??: ?? ??
</h2>
<p>?? ????? ???? ??? ??????(<em>ALB URL? ??? URL? ??</em>).<br>
</p>
<pre class="brush:php;toolbar:false">- [**python (3.13)**](https://www.python.org/)
- [**pipenv**](https://pipenv.pypa.io/en/latest/)
- [**npm**](https://nodejs.org/en/)
</pre>
<blockquote>
<p>?? ALB? ???? ??? ??? ?????!</p>
</blockquote>
<h2>
<strong>?? ??</strong>
</h2>
<p>AWS CDKTF? ???? Python? ???? ???? ?? ??? ??? IaC ??? ??? ? ????. ? ?? ??? AWS ECS Fargate?? Spring Boot API? ?? ?????? ?????? ??? ??????.</p>
<p>CDKTF? ???? Terraform? ??? ??? ???? ?? ???? ??? ?? ??? ??? ???.</p>
<p>CDKTF ????? ??? ??? ?? ?? ???? ??? ????? ??? ?? ????? ??? ?? ??? ?? ???? ???.</p>
<p>CDKTF? ?? ??? ???? ??? ??? ?????</p>
<p>??? ??? ???? ??? ???.</p>
</to></created>
? ??? CDKTF? ???? AWS EC? SpringBoot API? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











Python? Unittest ? Pytest? ??? ? ???? ??, ?? ? ??? ????? ? ?? ?? ???? ??? ??? ?????. 1. ??? ??? ?? ??? ???? ??? ??? ??? ?????. UnitTest? ??? ??? ???? ???? Test \ _? ???? ???? ?????. Pytest? ? ?????. Test \ _?? ???? ?? ? ??????. 2. ??? ?? ?? ? ?? ? ??? ??? ????. UnitTest? Assertequal, AssertTrue ? ?? ??? ???? ?? Pytest? ??? Assert ?? ???? ?? ?? ??? ???? ?????. 3. ?? ??? ?? ? ?? ????? ????? ????.

pythonisidealfordataanalysisduetonumpyandpandas.1) numpyexcelsatnumericalcomputationsfast, multi-dimensionalArraysandectorizedOferationsLikenp.sqrt ()

?? ????? (DP)? ??? ??? ? ??? ?? ??? ??? ??? ? ??? ??? ?? ??? ???? ??? ????? ??????. ? ?? ?? ??? ????. 1. ??? (??) : ??? ?? ??? ???? ??? ???? ?? ??? ??????. 2. ??? (?) : ?? ???? ???? ????? ?????. ???? ???, ?? ?? ?? ?? ??/?? ?, ??? ??? ?? ?? ?? ??? ??? ????? ?????. ?????? ????? ?? ???? ?? ??? ? ???, ?? ??? ???? ?? ?? ??? ???? ??? ???? ????? ???? ???????.

??? ?? ???? ????? ????? __iter_ ? __next__ ???? ???????. ① __iter__ ???? ??? ? ?? ??? ???? ??? ?? ?? ??? ?????. ② __next__ ???? ? ??? ?? ????, ?? ??? ??? ????, ? ?? ??? ??? stopiteration ??? ??????. status ??? ???? ??????? ?? ??? ??? ?? ?? ??? ???????. pile ?? ?? ???? ?? ??? ?? ? ??? ?? ? ??? ?????? ?????. simple ??? ??? ?? ?? ??? ?? ???? ???? ?? ??? ? ??? ?? ????? ???? ??? ??? ???????.

Python? ?? ???? ?? ???, ?? ?? ????, ?? ???? ?? ? AI/ML ??? ???? ??? ?????. ??, Cpython? ???? ????? ?? ??, ?? ?? ??? ? ?? ? ?? ??? ?? ??? ??????. ??, ??? ????? ?? ?? ? ?? ??? ????? ?? ?? ? ? ??? ?? ?????. ??, Pyscript ? Nuitka? ?? ?? ???? ??? ??? ?? ??? ?????. ?????, AI ? ??? ?? ??? ?? ???? ??? ?? ???????? ???? ?? ? ??? ?????. ??? ??? Python? ??? ??? ????? ???? ?? ??? ???? ??? ?????.

Python? ?? ??? ???? ?????? ????, ????? ? ?? ??????? ???? ? ??? ??? ???? ?? ??? ?????. ?? TCP ??? ????? Socket.Socket ()? ???? ??? ??? ?? ? ??? ????? .listen ()? ???? ??? ?? .accept ()? ?? ????? ??? ???????. TCP ?????? ????? ?? ??? ??? ??? ????? .connect ()? ?? ? ?? .sendall ()? ???? ???? ??? .recv ()? ?? ??? ??????. ?? ?????? ????? 1. ??? : ??? ??? ? ???? ??? ? ????. 2. ??? I/O : ?? ??, Asyncio ?????? ? ??? ??? ?? ? ? ????. ???? ? ?

Python List ????? ?? ?? ??? [Start : End : Step] ??? ????? ??? ???? ????. 1. ?? ????? ?? ??? ?? [start : end : step]???. ??? ?? ??? (??), ?? ? ??? (???? ??)?? ??? ?? ?????. 2. ????? ???? 0?? ????? ???? ????? ??? ??? ???? ????? ??? 1? ??????. 3. my_list [: n]? ???? ? ?? n ??? ?? my_list [-n :]? ???? ??? n ??? ????. 4. My_List [:: 2]? ?? ??? ?? ?? ??? ???? ??? ??? ?? ?? ?? ??? ???? ? ????. 5. ???? ???? ? ???? ???? ????

Python? DateTime ??? ?? ?? ? ?? ?? ?? ??? ?? ? ? ????. 1. DateTime.now ()? ?? ?? ??? ??? ?? ? ??? ?? .date () ? .time ()? ?? ? ? ????. 2. DateTime (? = 2025, ? = 12, ? = 25, ?? = 18, ? = 30)? ?? ?? ?? ? ?? ??? ???? ?? ? ? ????. 3. .strftime ()? ???? ???? ???? ??????. ???? ??? %y, %m, %d, %h, %m ? %s; strptime ()? ???? ???? datetime ??? ?? ??????. 4. ?? ??? Timedelta? ??????
