Tests a registered extension to make sure it meets all necessary requirements for being published in the CloudFormation registry.
-
For resource types, this includes passing all contracts tests defined for the type.
-
For modules, this includes determining if the module's model meets all necessary requirements.
For more information, see Testing your public extension before publishing in the CloudFormation Command Line Interface (CLI) User Guide.
If you don't specify a version, CloudFormation uses the default version of the extension in your account and Region for testing.
To perform testing, CloudFormation assumes the execution role specified when the type was registered. For more information, see RegisterType.
Once you've initiated testing on an extension using TestType, you can pass the returned TypeVersionArn into DescribeType to monitor the current test status and test status description for the extension.
An extension must have a test status of PASSED before it can be published. For more information, see Publishing extensions to make them available for public use in the CloudFormation Command Line Interface (CLI) User Guide.
Parameters:
-
arn
(Optional[TypeArn], default:
None
)
–
The Amazon Resource Name (ARN) of the extension.
Conditional: You must specify Arn, or TypeName and Type.
-
type
(Optional[ThirdPartyType], default:
None
)
–
The type of the extension to test.
Conditional: You must specify Arn, or TypeName and Type.
-
type_name
(Optional[TypeName], default:
None
)
–
The name of the extension to test.
Conditional: You must specify Arn, or TypeName and Type.
-
version_id
(Optional[TypeVersionId], default:
None
)
–
The version of the extension to test.
You can specify the version id with either Arn, or with TypeName and Type.
If you don't specify a version, CloudFormation uses the default version of the extension in this account and Region for testing.
-
log_delivery_bucket
(Optional[S3Bucket], default:
None
)
–
The S3 bucket to which CloudFormation delivers the contract test execution logs.
CloudFormation delivers the logs by the time contract testing has completed and the extension has been assigned a test type status of PASSED or FAILED.
The user calling TestType must be able to access items in the specified S3 bucket. Specifically, the user needs the following permissions:
For more information, see Actions, Resources, and Condition Keys for Amazon S3 in the Identity and Access Management User Guide.
Raises:
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
| async def test_type(
self,
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
arn: Optional["capo_cloudformation.types.type_arn.TypeArn"] = None,
type: Optional[
"capo_cloudformation.types.third_party_type.ThirdPartyType"
] = None,
type_name: Optional["capo_cloudformation.types.type_name.TypeName"] = None,
version_id: Optional[
"capo_cloudformation.types.type_version_id.TypeVersionId"
] = None,
log_delivery_bucket: Optional[
"capo_cloudformation.types.s3_bucket.S3Bucket"
] = None,
) -> "capo_cloudformation.types.test_type_output.TestTypeOutput":
"""<p>Tests a registered extension to make sure it meets all necessary requirements for being published in the CloudFormation registry.</p> <ul> <li> <p>For resource types, this includes passing all contracts tests defined for the type.</p> </li> <li> <p>For modules, this includes determining if the module's model meets all necessary requirements.</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/publish-extension.html#publish-extension-testing">Testing your public extension before publishing</a> in the <i>CloudFormation Command Line Interface (CLI) User Guide</i>.</p> <p>If you don't specify a version, CloudFormation uses the default version of the extension in your account and Region for testing.</p> <p>To perform testing, CloudFormation assumes the execution role specified when the type was registered. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a>.</p> <p>Once you've initiated testing on an extension using <code>TestType</code>, you can pass the returned <code>TypeVersionArn</code> into <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a> to monitor the current test status and test status description for the extension.</p> <p>An extension must have a test status of <code>PASSED</code> before it can be published. For more information, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-publish.html">Publishing extensions to make them available for public use</a> in the <i>CloudFormation Command Line Interface (CLI) User Guide</i>.</p>
Args:
arn: <p>The Amazon Resource Name (ARN) of the extension.</p> <p>Conditional: You must specify <code>Arn</code>, or <code>TypeName</code> and <code>Type</code>.</p>
type: <p>The type of the extension to test.</p> <p>Conditional: You must specify <code>Arn</code>, or <code>TypeName</code> and <code>Type</code>.</p>
type_name: <p>The name of the extension to test.</p> <p>Conditional: You must specify <code>Arn</code>, or <code>TypeName</code> and <code>Type</code>.</p>
version_id: <p>The version of the extension to test.</p> <p>You can specify the version id with either <code>Arn</code>, or with <code>TypeName</code> and <code>Type</code>.</p> <p>If you don't specify a version, CloudFormation uses the default version of the extension in this account and Region for testing.</p>
log_delivery_bucket: <p>The S3 bucket to which CloudFormation delivers the contract test execution logs.</p> <p>CloudFormation delivers the logs by the time contract testing has completed and the extension has been assigned a test type status of <code>PASSED</code> or <code>FAILED</code>.</p> <p>The user calling <code>TestType</code> must be able to access items in the specified S3 bucket. Specifically, the user needs the following permissions:</p> <ul> <li> <p> <code>GetObject</code> </p> </li> <li> <p> <code>PutObject</code> </p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html">Actions, Resources, and Condition Keys for Amazon S3</a> in the <i>Identity and Access Management User Guide</i>.</p>
Raises:
capo_cloudformation.errors.cfn_registry_exception.CFNRegistryException: <p>An error occurred during a CloudFormation registry operation.</p>
capo_cloudformation.errors.type_not_found_exception.TypeNotFoundException: <p>The specified extension doesn't exist in the CloudFormation registry.</p>
capo_cloudformation.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudformation.types.test_type_input.TestTypeInput]",
) -> AsyncOperationResponse[
"capo_cloudformation.types.test_type_output.TestTypeOutput"
]:
import capo_cloudformation._operations.cloud_formation.test_type
(
output,
http_response,
) = await capo_cloudformation._operations.cloud_formation.test_type.async_test_type(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TestType")
)
input_: capo_cloudformation.types.test_type_input.TestTypeInput = {}
if arn is not None:
input_["arn"] = arn
if type is not None:
input_["type"] = type
if type_name is not None:
input_["type_name"] = type_name
if version_id is not None:
input_["version_id"] = version_id
if log_delivery_bucket is not None:
input_["log_delivery_bucket"] = log_delivery_bucket
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|