stage is null from get_pipeline_state #4139
Unanswered
davema-clan
asked this question in
Q&A
Replies: 1 comment
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
from future import print_function
import boto3
import traceback
code_pipeline = boto3.client('codepipeline')
def put_job_success(job, message):
code_pipeline.put_job_success_result(jobId=job)
def put_job_failure(job, message):
code_pipeline.put_job_failure_result(jobId=job, failureDetails={'message': message, 'type': 'JobFailed'})
def lambda_handler(event, context):
try:
job_id = event['CodePipeline.job']['id']
state = code_pipeline.get_pipeline_state(name='test')
print(state)
stage = state['stageStates'][1]
print(state)
basic_check = stage['actionStates'][0]['latestExecution']['lastUpdatedBy']
finance_check = stage['actionStates'][1]['latestExecution']['lastUpdatedBy']
when I run the python scripte, I can't get state. my pipeline is v2.
if I create a pipeline for v1, it's fine.
stage:
{'pipelineName': 'test', 'pipelineVersion': 5, 'stageStates': [], 'created': datetime.datetime(2024, 5, 20, 10, 2, 36, 326000, tzinfo=tzlocal()), 'updated': datetime.datetime(2024, 5, 22, 10, 45, 54, 247000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '62f96d9b-4d95-904e-', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '62f96d9b-4d95-904e-', 'date': 'Wed, 22 May 2024 15:42:19 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '114', 'connection': 'keep-alive'}, 'RetryAttempts': 0}}
Beta Was this translation helpful? Give feedback.
All reactions