registerType method

Future<RegisterTypeOutput> registerType({
  1. required String schemaHandlerPackage,
  2. required String typeName,
  3. String? clientRequestToken,
  4. String? executionRoleArn,
  5. LoggingConfig? loggingConfig,
  6. RegistryType? type,
})

Registers a type with the CloudFormation service. Registering a type makes it available for use in CloudFormation templates in your AWS account, and includes:

  • Validating the resource schema
  • Determining which handlers have been specified for the resource
  • Making the resource type available for use in your account
For more information on how to develop types and ready them for registeration, see Creating Resource Providers in the CloudFormation CLI User Guide.

You can have a maximum of 50 resource type versions registered at a time. This maximum is per account and per region. Use DeregisterType to deregister specific resource type versions if necessary.

Once you have initiated a registration request using RegisterType , you can use DescribeTypeRegistration to monitor the progress of the registration request.

May throw CFNRegistryException.

Parameter schemaHandlerPackage : A url to the S3 bucket containing the schema handler package that contains the schema, event handlers, and associated files for the type you want to register.

For information on generating a schema handler package for the type you want to register, see submit in the CloudFormation CLI User Guide.

Parameter typeName : The name of the type being registered.

We recommend that type names adhere to the following pattern: company_or_organization::service::type.

  • Alexa
  • AMZN
  • Amazon
  • AWS
  • Custom
  • Dev

Parameter clientRequestToken : A unique identifier that acts as an idempotency key for this registration request. Specifying a client request token prevents CloudFormation from generating more than one version of a type from the same registeration request, even if the request is submitted multiple times.

Parameter executionRoleArn : The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource provider. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource provider handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource provider handler, thereby supplying your resource provider with the appropriate credentials.

Parameter loggingConfig : Specifies logging configuration information for a type.

Parameter type : The kind of type.

Currently, the only valid value is RESOURCE.

Implementation

Future<RegisterTypeOutput> registerType({
  required String schemaHandlerPackage,
  required String typeName,
  String? clientRequestToken,
  String? executionRoleArn,
  LoggingConfig? loggingConfig,
  RegistryType? type,
}) async {
  ArgumentError.checkNotNull(schemaHandlerPackage, 'schemaHandlerPackage');
  _s.validateStringLength(
    'schemaHandlerPackage',
    schemaHandlerPackage,
    1,
    4096,
    isRequired: true,
  );
  ArgumentError.checkNotNull(typeName, 'typeName');
  _s.validateStringLength(
    'typeName',
    typeName,
    10,
    204,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    128,
  );
  _s.validateStringLength(
    'executionRoleArn',
    executionRoleArn,
    1,
    256,
  );
  final $request = <String, dynamic>{};
  $request['SchemaHandlerPackage'] = schemaHandlerPackage;
  $request['TypeName'] = typeName;
  clientRequestToken?.also((arg) => $request['ClientRequestToken'] = arg);
  executionRoleArn?.also((arg) => $request['ExecutionRoleArn'] = arg);
  loggingConfig?.also((arg) => $request['LoggingConfig'] = arg);
  type?.also((arg) => $request['Type'] = arg.toValue());
  final $result = await _protocol.send(
    $request,
    action: 'RegisterType',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['RegisterTypeInput'],
    shapes: shapes,
    resultWrapper: 'RegisterTypeResult',
  );
  return RegisterTypeOutput.fromXml($result);
}