コード例 #1
0
        private void GetCloudFormationActionResources(PipelineActionCloudFormationOptions actionCloudFormationOptions, IDictionary <string, Artifact_> artifacts, out Artifact_ artifact, out IRole deploymentRole, out IRole role, out CfnCapabilities[] cfnCapabilities)
        {
            // Locate artifact
            if (string.IsNullOrWhiteSpace(actionCloudFormationOptions.InputArtifact))
            {
                throw new ArgumentException($"There is no input artifact in the pipeline action {actionCloudFormationOptions.Name}");
            }
            else
            {
                if (!artifacts.TryGetValue(actionCloudFormationOptions.InputArtifact, out artifact))
                {
                    throw new ArgumentException($"The artifact {actionCloudFormationOptions.InputArtifact} of the pipeline action {actionCloudFormationOptions.Name} was not found");
                }
            }

            // Locate deployment role
            deploymentRole = LocateRole(actionCloudFormationOptions.DeploymentRole,
                                        $"The role {actionCloudFormationOptions.DeploymentRole} of the pipeline action {actionCloudFormationOptions.Name} was not found",
                                        $"There is no deployment role in the pipeline action {actionCloudFormationOptions.Name}");

            // Locate role
            role = LocateRole(actionCloudFormationOptions.Role,
                              $"There is no role in the pipeline action {actionCloudFormationOptions.Name}",
                              $"The role {actionCloudFormationOptions.Role} of the pipeline action {actionCloudFormationOptions.Name} was not found");

            // Parse CfnCapabilites
            cfnCapabilities = actionCloudFormationOptions.CfnCapabilities.Select(x => Enum.Parse <CfnCapabilities>(x)).ToArray();
        }
コード例 #2
0
        private void CreateCloudFormationAction(IStage stage, IDictionary <string, Artifact_> artifacts, PipelineActionCloudFormationOptions actionCloudFormationOptions)
        {
            GetCloudFormationActionResources(actionCloudFormationOptions, artifacts, out var artifact, out var deploymentRole, out var role, out var cfnCapabilites);

            AwsCdkHandler.CreateCloudFormationCreateUpdateStackActionInStage(stage, actionCloudFormationOptions.Name, artifact, actionCloudFormationOptions.TemplatePath, actionCloudFormationOptions.StackName, deploymentRole, role, cfnCapabilites);
        }