feat:VPCエンドポイント追加のため、セキュリティグループを追加した
feat:引数の追加のため、ECS起動パラメータに値を追加した
This commit is contained in:
parent
37d2c9dbdb
commit
1d8cdace48
@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from os import path
|
|
||||||
import boto3
|
import boto3
|
||||||
|
|
||||||
ecs_client = boto3.client('ecs')
|
ecs_client = boto3.client('ecs')
|
||||||
@ -10,7 +9,9 @@ TASK_NAME = os.environ['TASK_NAME']
|
|||||||
CONTAINER_NAME = os.environ['CONTAINER_NAME']
|
CONTAINER_NAME = os.environ['CONTAINER_NAME']
|
||||||
SUBNET_ID_AP_NORTHEAST_1A = os.environ['SUBNET_ID_AP_NORTHEAST_1A']
|
SUBNET_ID_AP_NORTHEAST_1A = os.environ['SUBNET_ID_AP_NORTHEAST_1A']
|
||||||
SUBNET_ID_AP_NORTHEAST_1D = os.environ['SUBNET_ID_AP_NORTHEAST_1D']
|
SUBNET_ID_AP_NORTHEAST_1D = os.environ['SUBNET_ID_AP_NORTHEAST_1D']
|
||||||
SECURITY_GROUP_ID = os.environ['SECURITY_GROUP_ID']
|
SECURITY_GROUP_ID_ECRAPI = os.environ['SECURITY_GROUP_ID_ECRAPI']
|
||||||
|
SECURITY_GROUP_ID_ECRDKR = os.environ['SECURITY_GROUP_ID_ECRDKR']
|
||||||
|
SECURITY_GROUP_ID_LOGS = os.environ['SECURITY_GROUP_ID_LOGS']
|
||||||
|
|
||||||
|
|
||||||
def lambda_handler(event, context):
|
def lambda_handler(event, context):
|
||||||
@ -34,10 +35,13 @@ def lambda_handler(event, context):
|
|||||||
networkConfiguration={
|
networkConfiguration={
|
||||||
'awsvpcConfiguration': {
|
'awsvpcConfiguration': {
|
||||||
'subnets': [
|
'subnets': [
|
||||||
SUBNET_ID_AP_NORTHEAST_1A, SUBNET_ID_AP_NORTHEAST_1D,
|
SUBNET_ID_AP_NORTHEAST_1A,
|
||||||
|
SUBNET_ID_AP_NORTHEAST_1D,
|
||||||
],
|
],
|
||||||
'securityGroups': [
|
'securityGroups': [
|
||||||
SECURITY_GROUP_ID,
|
SECURITY_GROUP_ID_ECRAPI,
|
||||||
|
SECURITY_GROUP_ID_ECRDKR,
|
||||||
|
SECURITY_GROUP_ID_LOGS,
|
||||||
],
|
],
|
||||||
'assignPublicIp': 'ENABLED',
|
'assignPublicIp': 'ENABLED',
|
||||||
}
|
}
|
||||||
@ -47,8 +51,10 @@ def lambda_handler(event, context):
|
|||||||
{
|
{
|
||||||
'name': CONTAINER_NAME,
|
'name': CONTAINER_NAME,
|
||||||
'environment': [
|
'environment': [
|
||||||
{'name': 'FILE_NAME', 'value': event_file_name},
|
{'name': 'BUCKET_NAME', 'value': event_bucket_name},
|
||||||
|
{'name': 'TARGET_KEY', 'value': event_object_key},
|
||||||
{'name': 'DATA_SOURCE_NAME', 'value': event_data_source_name},
|
{'name': 'DATA_SOURCE_NAME', 'value': event_data_source_name},
|
||||||
|
{'name': 'FILE_NAME', 'value': event_file_name},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user