Class PipelineProjectResource


  • public class PipelineProjectResource
    extends Object
    Model for handled resource.
    • Field Detail

      • DEFAULT_LOGS_RETENTION_DAYS

        private static final Number DEFAULT_LOGS_RETENTION_DAYS
        Default retention period for logs (in days).
      • PROPERTY_LOG_GROUP_NAME

        private static final String PROPERTY_LOG_GROUP_NAME
        LogGroupName property name.
        See Also:
        Constant Field Values
      • PROPERTY_LOGS_RETENTION_IN_DAYS

        private static final String PROPERTY_LOGS_RETENTION_IN_DAYS
        LogsRetentionInDays property name.
        See Also:
        Constant Field Values
      • PROPERTY_KEY_COMPUTE_TYPE

        private static final String PROPERTY_KEY_COMPUTE_TYPE
        Property key "ComputeType".
        See Also:
        Constant Field Values
      • PROPERTY_KEY_ENVIRONMENTVARIABLES

        private static final String PROPERTY_KEY_ENVIRONMENTVARIABLES
        Property key "EnvironmentVariables".
        See Also:
        Constant Field Values
      • logicalId

        private String logicalId
        Resource name.
      • condition

        private String condition
        Creation condition.
    • Constructor Detail

      • PipelineProjectResource

        public PipelineProjectResource​(String logicalId,
                                       String condition)
    • Method Detail

      • buildDefinitions

        public Map<String,​Object> buildDefinitions​(Map<String,​Object> properties)
        Builds definition of physical resources.
        Parameters:
        properties - Properties for our custom resource.
        Returns:
        Definitions of all resources.
      • createLogGroup

        private void createLogGroup​(Map<String,​Object> resources,
                                    Map<String,​Object> properties)
        Creates log group resource definition.
        Parameters:
        resources - Resources container.
        properties - Resource properties.
      • createCodeBuildProject

        private void createCodeBuildProject​(Map<String,​Object> resources,
                                            Map<String,​Object> properties)
        Creates project resource definition.
        Parameters:
        resources - Resources container.
        properties - Resource properties.
      • getLogGroupLogicalId

        public String getLogGroupLogicalId()
        Builds logical ID of LogGroup resource.
        Returns:
        LogGroup logical ID.
      • generateResource

        private void generateResource​(Map<String,​Object> resources,
                                      String suffix,
                                      String type,
                                      Map<String,​Object> properties)
        Adds resource to collection.
        Parameters:
        resources - Resources container.
        suffix - Resource logical ID suffix.
        type - CloudFormation resource type.
        properties - Resource configuration.
      • generateArtifactsDelegation

        private static Map<String,​Object> generateArtifactsDelegation()
        Generates artifacts reference for CodePipeline.
        Returns:
        CodePipeline setup for CodeBuild.
      • addMapToEntries

        private static List<Object> addMapToEntries​(Object container,
                                                    Object map)
        Converts key-value mapping to list of entries.
        Parameters:
        container - Entries container.
        map - Key-value container.
        Returns:
        List container.
      • buildEnvironmentVariable

        private static Map<String,​Object> buildEnvironmentVariable​(String key,
                                                                         Object value)
        Builds CodeBuild environment variable definition.
        Parameters:
        key - Variable name.
        value - Variable value.
        Returns:
        Variable entry.