Sono disponibili altri esempi per SDK AWS nel repository GitHub della documentazione degli esempi per SDK AWS
Utilizzare GetTemplate con una CLI
Gli esempi di codice seguenti mostrano come utilizzare GetTemplate.
- CLI
-
- AWS CLI
-
Come visualizzare il corpo del modello per uno stack AWS CloudFormation
Il comando
get-templateseguente mostra il modello per lo stackmyteststack:aws cloudformation get-template --stack-namemyteststackOutput:
{ "TemplateBody": { "AWSTemplateFormatVersion": "2010-09-09", "Outputs": { "BucketName": { "Description": "Name of S3 bucket to hold website content", "Value": { "Ref": "S3Bucket" } } }, "Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.", "Resources": { "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { "AccessControl": "PublicRead" } } } } }-
Per informazioni dettagliate sull’API, consulta GetTemplate
in AWS CLI Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: restituisce il modello associato allo stack specificato.
Get-CFNTemplate -StackName "myStack"-
Per informazioni dettagliate sull’API, consulta GetTemplate nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V4).
-
- Strumenti per PowerShell V5
-
Esempio 1: restituisce il modello associato allo stack specificato.
Get-CFNTemplate -StackName "myStack"-
Per informazioni dettagliate sull’API, consulta GetTemplate nella documentazione di riferimento dei cmdlet di AWS Strumenti per PowerShell (V5).
-