AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the UpdateGeneratedTemplate operation. Updates a generated template. This can be used to change the name, add and remove resources, refresh resources, and change the DeletionPolicy and UpdateReplacePolicy settings. You can check the status of the update to the generated template using the DescribeGeneratedTemplate API action.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.CloudFormation.AmazonCloudFormationRequest
      Amazon.CloudFormation.Model.UpdateGeneratedTemplateRequest

Namespace: Amazon.CloudFormation.Model
Assembly: AWSSDK.CloudFormation.dll
Version: 3.x.y.z

Syntax

C#
public class UpdateGeneratedTemplateRequest : AmazonCloudFormationRequest
         IAmazonWebServiceRequest

The UpdateGeneratedTemplateRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property AddResources System.Collections.Generic.List<Amazon.CloudFormation.Model.ResourceDefinition>

Gets and sets the property AddResources.

An optional list of resources to be added to the generated template.

Public Property GeneratedTemplateName System.String

Gets and sets the property GeneratedTemplateName.

The name or Amazon Resource Name (ARN) of a generated template.

Public Property NewGeneratedTemplateName System.String

Gets and sets the property NewGeneratedTemplateName.

An optional new name to assign to the generated template.

Public Property RefreshAllResources System.Boolean

Gets and sets the property RefreshAllResources.

If true, update the resource properties in the generated template with their current live state. This feature is useful when the resource properties in your generated a template does not reflect the live state of the resource properties. This happens when a user update the resource properties after generating a template.

Public Property RemoveResources System.Collections.Generic.List<System.String>

Gets and sets the property RemoveResources.

A list of logical ids for resources to remove from the generated template.

Public Property TemplateConfiguration Amazon.CloudFormation.Model.TemplateConfiguration

Gets and sets the property TemplateConfiguration.

The configuration details of the generated template, including the DeletionPolicy and UpdateReplacePolicy.

Examples

This example updates a generated template with a new name.

To update a generated template's name


var client = new AmazonCloudFormationClient();
var response = client.UpdateGeneratedTemplate(new UpdateGeneratedTemplateRequest 
{
    GeneratedTemplateName = "JazzyTemplate",
    NewGeneratedTemplateName = "JazzierTemplate"
});

string generatedTemplateId = response.GeneratedTemplateId;

            

This example removes resources from a generated template

To remove resources from a generated template


var client = new AmazonCloudFormationClient();
var response = client.UpdateGeneratedTemplate(new UpdateGeneratedTemplateRequest 
{
    GeneratedTemplateName = "JazzyTemplate",
    RemoveResources = new List<string> {
        "LogicalResourceId1",
        "LogicalResourceId2"
    }
});

string generatedTemplateId = response.GeneratedTemplateId;

            

This example adds resources to a generated template

To add resources to a generated template


var client = new AmazonCloudFormationClient();
var response = client.UpdateGeneratedTemplate(new UpdateGeneratedTemplateRequest 
{
    AddResources = new List<ResourceDefinition> {
        new ResourceDefinition {
            ResourceIdentifier = new Dictionary<string, string> {
                { "BucketName", "jazz-bucket" }
            },
            ResourceType = "AWS::S3::Bucket"
        },
        new ResourceDefinition {
            ResourceIdentifier = new Dictionary<string, string> {
                { "DhcpOptionsId", "random-id123" }
            },
            ResourceType = "AWS::EC2::DHCPOptions"
        }
    },
    GeneratedTemplateName = "JazzyTemplate"
});

string generatedTemplateId = response.GeneratedTemplateId;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5