private Amazon.CloudFormation.Model.CreateChangeSetResponse CallAWSServiceOperation(IAmazonCloudFormation client, Amazon.CloudFormation.Model.CreateChangeSetRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudFormation", "CreateChangeSet"); try { #if DESKTOP return(client.CreateChangeSet(request)); #elif CORECLR return(client.CreateChangeSetAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CloudFormation.Model.CreateChangeSetRequest(); if (cmdletContext.Capability != null) { request.Capabilities = cmdletContext.Capability; } if (cmdletContext.ChangeSetName != null) { request.ChangeSetName = cmdletContext.ChangeSetName; } if (cmdletContext.ChangeSetType != null) { request.ChangeSetType = cmdletContext.ChangeSetType; } if (cmdletContext.ClientToken != null) { request.ClientToken = cmdletContext.ClientToken; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.NotificationARNs != null) { request.NotificationARNs = cmdletContext.NotificationARNs; } if (cmdletContext.Parameter != null) { request.Parameters = cmdletContext.Parameter; } if (cmdletContext.ResourceType != null) { request.ResourceTypes = cmdletContext.ResourceType; } if (cmdletContext.RoleARN != null) { request.RoleARN = cmdletContext.RoleARN; } if (cmdletContext.RollbackConfiguration != null) { request.RollbackConfiguration = cmdletContext.RollbackConfiguration; } if (cmdletContext.StackName != null) { request.StackName = cmdletContext.StackName; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TemplateBody != null) { request.TemplateBody = cmdletContext.TemplateBody; } if (cmdletContext.TemplateURL != null) { request.TemplateURL = cmdletContext.TemplateURL; } if (cmdletContext.UsePreviousTemplate != null) { request.UsePreviousTemplate = cmdletContext.UsePreviousTemplate.Value; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Creates a list of changes for a stack. AWS CloudFormation generates the change set /// by comparing the template's information with the information that you submit. A change /// set can help you understand which resources AWS CloudFormation will change, and how /// it will change them, before you update your stack. Change sets allow you to check /// before making a change to avoid deleting or replacing critical resources. /// /// /// <para> /// AWS CloudFormation doesn't make any changes to the stack when you create a change /// set. To make the specified changes, you must execute the change set by using the <a>ExecuteChangeSet</a> /// action. /// </para> /// /// <para> /// After the call successfully completes, AWS CloudFormation starts creating the change /// set. To check the status of the change set, use the <a>DescribeChangeSet</a> action. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateChangeSet service method.</param> /// /// <returns>The response from the CreateChangeSet service method, as returned by CloudFormation.</returns> /// <exception cref="Amazon.CloudFormation.Model.AlreadyExistsException"> /// Resource with the name requested already exists. /// </exception> /// <exception cref="Amazon.CloudFormation.Model.InsufficientCapabilitiesException"> /// The template contains resources with capabilities that were not specified in the Capabilities /// parameter. /// </exception> /// <exception cref="Amazon.CloudFormation.Model.LimitExceededException"> /// Quota for the resource has already been reached. /// </exception> public CreateChangeSetResponse CreateChangeSet(CreateChangeSetRequest request) { var marshaller = new CreateChangeSetRequestMarshaller(); var unmarshaller = CreateChangeSetResponseUnmarshaller.Instance; return Invoke<CreateChangeSetRequest,CreateChangeSetResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateChangeSet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateChangeSet operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<CreateChangeSetResponse> CreateChangeSetAsync(CreateChangeSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateChangeSetRequestMarshaller(); var unmarshaller = CreateChangeSetResponseUnmarshaller.Instance; return InvokeAsync<CreateChangeSetRequest,CreateChangeSetResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateChangeSet operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateChangeSet operation on AmazonCloudFormationClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateChangeSet /// operation.</returns> public IAsyncResult BeginCreateChangeSet(CreateChangeSetRequest request, AsyncCallback callback, object state) { var marshaller = new CreateChangeSetRequestMarshaller(); var unmarshaller = CreateChangeSetResponseUnmarshaller.Instance; return BeginInvoke<CreateChangeSetRequest>(request, marshaller, unmarshaller, callback, state); }