Ec2DeploySpecificationsInlineProps
- class aws_cdk.aws_codepipeline_actions.Ec2DeploySpecificationsInlineProps(*, post_script, target_directory, pre_script=None)
Bases:
object
Properties of
Ec2DeploySpecifications.inline()
.- Parameters:
post_script (
str
) – Path to the executable script file that runs AFTER the Deploy phase. It should start from the root directory of your uploaded source artifact. Use an absolute path likeuploadDir/postScript.sh
.target_directory (
str
) – The location of the target directory you want to deploy to. Use an absolute path like/home/ec2-user/deploy
.pre_script (
Optional
[str
]) – Path to the executable script file that runs BEFORE the Deploy phase. It should start from the root directory of your uploaded source artifact. Use an absolute path likeuploadDir/preScript.sh
. Default: - No script
- ExampleMetadata:
infused
Example:
source_output = codepipeline.Artifact() pipeline = codepipeline.Pipeline(self, "MyPipeline", pipeline_type=codepipeline.PipelineType.V2 ) deploy_action = codepipeline_actions.Ec2DeployAction( action_name="Ec2Deploy", input=source_output, instance_type=codepipeline_actions.Ec2InstanceType.EC2, instance_tag_key="Name", instance_tag_value="MyInstance", deploy_specifications=codepipeline_actions.Ec2DeploySpecifications.inline( target_directory="/home/ec2-user/deploy", pre_script="scripts/pre-deploy.sh", post_script="scripts/post-deploy.sh" ) ) deploy_stage = pipeline.add_stage( stage_name="Deploy", actions=[deploy_action] )
Attributes
- post_script
Path to the executable script file that runs AFTER the Deploy phase.
It should start from the root directory of your uploaded source artifact. Use an absolute path like
uploadDir/postScript.sh
.
- pre_script
Path to the executable script file that runs BEFORE the Deploy phase.
It should start from the root directory of your uploaded source artifact. Use an absolute path like
uploadDir/preScript.sh
.- Default:
No script
- target_directory
The location of the target directory you want to deploy to.
Use an absolute path like
/home/ec2-user/deploy
.