a. ACL 작성
{ "Version": "2012-10-17",
"Id": "Polic y1700440993280",
"Statement": [
{
"Sid": "Stmt1700440977436",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::cyan-bucket/*"
}
]
}
aws s3 ls
aws s3 sync . s3://cyan-bucket2/web
reference
NoSQL 테이블 생성
a. DynamoDB 콘솔에서 테이블생성 버튼
b. 테이블 세부정보 입력
테이블이름 : Music
파티션키 : Artist
정렬키 : songTitle
c. 테이블생성
** 파티션 키는 확장성을 위해 파티션 간에 데이터를 분산하는 데 사용됩니다. 값 범위가 넓고 액세스 패턴이 고르게 분산될 가능성이 있는 속성을 선택하는 것이 중요합니다.
NoSQL 테이블 데이터 입력
a. 항목탐색
b. 좌축 메뉴에서 Music 선택
c. 항목생성 버튼
d. 값입력
e. 항목생성
NoSQL 테이블 조회
데이터 삭제
NoSQL 테이블 삭제
reference
a. AWS CLI 설치
다운로드 : https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
파일명 : AWSCLIV2.msi
b. 설치 확인
C:\Users\user>aws --version
aws-cli/2.22.12 Python/3.12.6 Windows/11 exe/AMD64
c. sso 설정
C:\Users\user>aws configure sso
SSO session name (Recommended): Test1
SSO start URL [None]: https://d-9b67788a7b.awsapps.com/start
SSO region [None]: ap-northeast-2
SSO registration scopes [sso:account:access]:
Attempting to automatically open the SSO authorization page in your default browser.
aws s3 ls --profile admin-1
aws ec2 describe-vpcs --profile admin-1
aws dynamodb list-tables --profile
reference
IAM(Identity and Access Management) : 리소스 접근 권한
import boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('Music')
def lambda_handler(event, context):
try:
response=table.put_item(Item=event)
return table.scan()
except:
raise
reference
https://docs.aws.amazon.com/ko_kr/lambda/latest/dg/services-apigateway-tutorial.html
aws lambda invoke ^
--function-name LambdaFunctionOverHttps ^
--payload file://input.txt outputfile.txt ^
--cli-binary-format raw-in-base64-out --profile admin-1
curl https://5bwffjeoq6.execute-api.ap-northeast-2.amazonaws.com/test/DynamoDBManager ^
-d '{"operation": "create", "payload": {"Item": {"id": "5678EFGH", "number": 15}}}'
curl https://5bwffjeoq6.execute-api.ap-northeast-2.amazonaws.com/test/DynamoDBManager -d ^
"{\"operation\": \"read\", \"payload\": {\"Key\": {\"id\": \"5678EFGH\"}}}"
VPC 구성요소