1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
動作確認していないですが、こんな感じで動かせると思います。
NAT Gatewayの名前はNameタグで設定するので"TagSpecifications"にある"Tags"で設定を行います。
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/create_nat_gateway.html
import boto3
ec2 = boto3.client('ec2')
def lambda_handler(event, context):
ec2.create_nat_gateway(
AllocationId='ElasticIPのID',
SubnetId='NAT Gatewayを設定するサブネットID',
TagSpecifications=[
{
'ResourceType': 'natgateway',
'Tags': [
{
'Key': 'Name',
'Value': 'NAT Gatewayに設定したい名前'
},
]
},
],
ConnectivityType='public'
)
Contenus pertinents
- demandé il y a 6 mois
- demandé il y a 21 jours
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans