11월, 2024의 게시물 표시

How to use environment variables in springboot

spring.config.import=optional:.env[.properties] with the above code in application file(application.properties / yml), you can use the environment variable in your project 1. in application file in application file, you can just use ${ variable_name } to use the variable. 2. in code in code(java files), you can use annotation @Value("{ variable_name}" ) to use the variable. 3. ConfigurationProperties if env variables are grouped with prefix (like apple.name and apple.count), you can easily map them through Configuration Properties.  For example, instead of writing @Value("{apple.name}") and @Value("{apple.count}") respectively, you can just write @ConfigurationProperties(prefix = "apple") public class AppleProperties {     private string name;     private int count; }

OSI Model

[Physical Quantity(Radiowave, Electric signal, Infrared Signal, etc)] 1: Physical Layer: converts data into physical quantity so that it can be physically transmitted >Wi-fi chip, ethernet port and cable, etc [Packets] 2. Data Link Layer: Manages data transfer between directly connected nodes such as error detection or flow control   - MAC Layer: controls how device gains access to medium and permission to use network   - LLC Layer: identifies and encapsualtes Network Layer Protocol(Not whole), check error and synchornizes frames [Packets] 3. Network Layer: Forwards received packet to another adjacent node, which enables "network"(in contrast to 1:1 communication)  - Router conducts routing in this layer [Segments] 4. Transport Layer: segments data and grants sequence number to them.   - One of the most important layers.   - Converts data into binary, segments and grants sequence and etc 5. Session Layer: manages the session between end and the another end [...

AWS ECS(Elastic Container Service)

 Task definition The first object that should be created for the ECS. It is literally the template that is referred to when the task is made. It is very much likely a 'docker run' command. It defines things like 1. Launch type(EC2 or Fargate) 2. Container environment(OS, Architecture, CPU, RAM size, etc) 3. Network mode(vpc, host, etc) 4. docker image(through URI) 5. Port Mapping 6. Environment variables  7. Logging options One important thing is, that you can put multiple containers in a single task definition. Those containers can communicate through link settings. Regarding it, Task definition might be closer to docker-compose up rather than docker run. + However, container-per-task is highly recommended because putting multiple containers in a  single task might hinder effective scaling. Task definition consists of 'family name' and 'revision'. When you create a brand new Task definition, you can grant it a 'family name' and revision number is 1. If ...

AWS Deployment

 CIDR:  Load Balancer Load Balancer literally distributes the traffic that are requested to the its listener into different computing resource like container or instance. The criterion it uses for distribution is called 'target type'. Target types can be instance id, IP address, lambda function or else.