예제 #1
0
        private async Task InstallAsync(RunningDeployment deployment)
        {
            var stack = stackProvider(deployment);

            Guard.NotNull(stack, "The provided stack may not be null");

            var name = deployment.Variables[AwsSpecialVariables.CloudFormation.Changesets.Name];

            Guard.NotNullOrWhiteSpace(name, "The changeset name must be provided.");

            var template = templateFactory();

            Guard.NotNull(template, "CloudFormation template should not be null.");

            try
            {
                var changeset = await CreateChangeSet(await template.BuildChangesetRequest());
                await WaitForChangesetCompletion(changeset);

                ApplyVariables(deployment.Variables)(changeset);
            }
            catch (AmazonServiceException exception)
            {
                LogAmazonServiceException(exception);
                throw;
            }
        }
예제 #2
0
        private async Task InstallAsync(RunningDeployment deployment)
        {
            var stack = stackProvider(deployment);

            Guard.NotNull(stack, "The provided stack may not be null");

            var name = deployment.Variables[AwsSpecialVariables.CloudFormation.Changesets.Name];

            Guard.NotNullOrWhiteSpace(name, "The changeset name must be provided.");

            var template = templateFactory();

            Guard.NotNull(template, "CloudFormation template should not be null.");

            try
            {
                var status = await clientFactory.StackExistsAsync(stack, StackStatus.DoesNotExist);

                var changeset = await CreateChangeSet(
                    CreateChangesetRequest(
                        status,
                        name,
                        stack,
                        roleArnProvider?.Invoke(deployment),
                        template,
                        Capabilities
                        )
                    );
                await WaitForChangesetCompletion(changeset);

                ApplyVariables(deployment.Variables)(changeset);
            }
            catch (AmazonServiceException exception)
            {
                LogAmazonServiceException(exception);
                throw;
            }
        }