Class PipelineProjectResource
- java.lang.Object
-
- pl.wrzasq.lambda.macro.pipeline.project.template.PipelineProjectResource
-
public class PipelineProjectResource extends Object
Model for handled resource.
-
-
Field Summary
Fields Modifier and Type Field Description private String
condition
Creation condition.private static Number
DEFAULT_LOGS_RETENTION_DAYS
Default retention period for logs (in days).private String
logicalId
Resource name.private static String
PROPERTY_ARTIFACTS
Artifacts property name.private static String
PROPERTY_ENVIRONMENT
Environment property name.private static String
PROPERTY_KEY_COMPUTE_TYPE
Property key "ComputeType".private static String
PROPERTY_KEY_ENVIRONMENTVARIABLES
Property key "EnvironmentVariables".private static String
PROPERTY_KEY_TYPE
Property key "Type".private static String
PROPERTY_LOG_GROUP_NAME
LogGroupName property name.private static String
PROPERTY_LOGS_RETENTION_IN_DAYS
LogsRetentionInDays property name.private static String
PROPERTY_SOURCE
Source property name.static String
RESOURCE_TYPE
Resource type identifier.
-
Constructor Summary
Constructors Constructor Description PipelineProjectResource(String logicalId, String condition)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static List<Object>
addMapToEntries(Object container, Object map)
Converts key-value mapping to list of entries.Map<String,Object>
buildDefinitions(Map<String,Object> properties)
Builds definition of physical resources.private static Map<String,Object>
buildEnvironmentVariable(String key, Object value)
Builds CodeBuild environment variable definition.private void
createCodeBuildProject(Map<String,Object> resources, Map<String,Object> properties)
Creates project resource definition.private void
createLogGroup(Map<String,Object> resources, Map<String,Object> properties)
Creates log group resource definition.private static Map<String,Object>
generateArtifactsDelegation()
Generates artifacts reference for CodePipeline.private void
generateResource(Map<String,Object> resources, String suffix, String type, Map<String,Object> properties)
Adds resource to collection.String
getLogGroupLogicalId()
Builds logical ID of LogGroup resource.
-
-
-
Field Detail
-
RESOURCE_TYPE
public static final String RESOURCE_TYPE
Resource type identifier.- See Also:
- Constant Field Values
-
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_ARTIFACTS
private static final String PROPERTY_ARTIFACTS
Artifacts property name.- See Also:
- Constant Field Values
-
PROPERTY_SOURCE
private static final String PROPERTY_SOURCE
Source property name.- See Also:
- Constant Field Values
-
PROPERTY_ENVIRONMENT
private static final String PROPERTY_ENVIRONMENT
Environment property name.- See Also:
- Constant Field Values
-
PROPERTY_KEY_TYPE
private static final String PROPERTY_KEY_TYPE
Property key "Type".- 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.
-
-
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.
-
-