- Newest
- Most votes
- Most comments
It appears that you're encountering an issue with the start_pipeline_execution method in Boto3 not recognizing the variables parameter. This is likely due to a discrepancy between the Boto3 documentation and the actual implementation.
The variables parameter is indeed mentioned in the Boto3 documentation for start_pipeline_execution, but it seems that the current implementation of the method does not support this parameter. This could be due to a lag between the API documentation and the actual implementation in the Boto3 library.
To work around this issue, you have a couple of options:
-
Use pipeline-level variables: Instead of trying to pass variables at execution time, you can define pipeline-level variables when creating or updating the pipeline. These variables can then be referenced within your pipeline actions.
-
Use the AWS CLI or SDK to start the pipeline execution: If you need to pass variables at runtime, you might need to use the AWS CLI or a different SDK that supports this feature.
For the pipeline-level variables approach, you would first need to update your pipeline configuration to include the variables. This can be done using the update_pipeline method. Here's an example of how you might do this:
pipeline_data = cp.get_pipeline(name='ci-cd-pipeline') pipeline_data['pipeline']['variables'] = [ { 'name': 'RepositoryName', 'defaultValue': 'default_repo_name', 'description': 'The name of the repository' } ] cp.update_pipeline(pipeline=pipeline_data['pipeline'])
After setting up the pipeline-level variables, you can start the pipeline execution without specifying variables:
cp.start_pipeline_execution(name='ci-cd-pipeline')
The pipeline will use the default value for the variable unless overridden elsewhere in your pipeline configuration.
If you absolutely need to pass variables at runtime, you might need to explore other options like using the AWS CLI or a different SDK until Boto3 fully supports this feature for the start_pipeline_execution method.
Sources
PipelineVariable - CodePipeline
Variables reference - AWS CodePipeline
answered 2 years ago
Relevant content
- AWS OFFICIALUpdated 7 months ago
