Is there an existing issue for this?
Describe the bug
Unable to execute Terraform pipeline due to an error in CodeBuild stage
Expected Behavior
Module get_account.py should run with no error
Current Behavior
During Terraform pipeline execution CodeBuild return the following error:
Traceback (most recent call last): File "adf-build/helpers/terraform/get_accounts.py", line 190, in <module> main() File "adf-build/helpers/terraform/get_accounts.py", line 36, in main accounts_from_ous = get_accounts_from_ous() File "adf-build/helpers/terraform/get_accounts.py", line 95, in get_accounts_from_ous organizations = get_boto3_client( File "adf-build/helpers/terraform/get_accounts.py", line 145, in get_boto3_client role = sts.assume_role( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 514, in _api_call return self._make_api_call(operation_name, kwargs) File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 901, in _make_api_call request_dict = self._convert_to_request_dict( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 962, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/validate.py", line 381, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter RoleArn, value: ('arn:aws:sts::778473862620:role/OrganizationAccountAccessRole-readonly',), type: <class 'tuple'>, valid types: <class 'str'>
Steps To Reproduce
No response
Possible Solution
Change the type of input parameter from tupla to string
organizations = get_boto3_client( 'organizations', f'arn:{PARTITION}:sts::{MANAGEMENT_ACCOUNT_ID}:role/{CROSS_ACCOUNT_ACCESS_ROLE}-readonly', 'getaccountIDs', )
Additional Information/Context
No response
ADF Version
3.2.0
Is there an existing issue for this?
Describe the bug
Unable to execute Terraform pipeline due to an error in CodeBuild stage
Expected Behavior
Module get_account.py should run with no error
Current Behavior
During Terraform pipeline execution CodeBuild return the following error:
Traceback (most recent call last): File "adf-build/helpers/terraform/get_accounts.py", line 190, in <module> main() File "adf-build/helpers/terraform/get_accounts.py", line 36, in main accounts_from_ous = get_accounts_from_ous() File "adf-build/helpers/terraform/get_accounts.py", line 95, in get_accounts_from_ous organizations = get_boto3_client( File "adf-build/helpers/terraform/get_accounts.py", line 145, in get_boto3_client role = sts.assume_role( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 514, in _api_call return self._make_api_call(operation_name, kwargs) File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 901, in _make_api_call request_dict = self._convert_to_request_dict( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/client.py", line 962, in _convert_to_request_dict request_dict = self._serializer.serialize_to_request( File "/root/.pyenv/versions/3.8.13/lib/python3.8/site-packages/botocore/validate.py", line 381, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter RoleArn, value: ('arn:aws:sts::778473862620:role/OrganizationAccountAccessRole-readonly',), type: <class 'tuple'>, valid types: <class 'str'>Steps To Reproduce
No response
Possible Solution
Change the type of input parameter from tupla to string
organizations = get_boto3_client( 'organizations', f'arn:{PARTITION}:sts::{MANAGEMENT_ACCOUNT_ID}:role/{CROSS_ACCOUNT_ACCESS_ROLE}-readonly', 'getaccountIDs', )Additional Information/Context
No response
ADF Version
3.2.0