putConfigurationRecorder method
- required ConfigurationRecorder configurationRecorder,
- List<
Tag> ? tags,
Creates or updates the customer managed configuration recorder.
You can use this operation to create a new customer managed configuration
recorder or to update the roleARN and the
recordingGroup for an existing customer managed configuration
recorder.
To start the customer managed configuration recorder and begin recording configuration changes for the resource types you specify, use the StartConfigurationRecorder operation.
For more information, see Working with the Configuration Recorder in the Config Developer Guide.
You can create only one customer managed configuration recorder for each account for each Amazon Web Services Region.
Default is to record all supported resource types, excluding the global IAM resource types
If you have not specified values for the recordingGroup
field, the default for the customer managed configuration recorder is to
record all supported resource types, excluding the global IAM resource
types: AWS::IAM::Group, AWS::IAM::Policy,
AWS::IAM::Role, and AWS::IAM::User.
Tags are added at creation and cannot be updated
PutConfigurationRecorder is an idempotent API. Subsequent
requests won’t create a duplicate resource if one was already created. If
a following request has different tags values, Config will ignore these
differences and treat it as an idempotent request of the previous. In this
case, tags will not be updated, even if they are different.
Use TagResource and UntagResource to update tags after creation.
May throw InvalidConfigurationRecorderNameException.
May throw InvalidRecordingGroupException.
May throw InvalidRoleException.
May throw MaxNumberOfConfigurationRecordersExceededException.
May throw UnmodifiableEntityException.
May throw ValidationException.
Parameter configurationRecorder :
An object for the configuration recorder. A configuration recorder records
configuration changes for the resource types in scope.
Parameter tags :
The tags for the customer managed configuration recorder. Each tag
consists of a key and an optional value, both of which you define.
Implementation
Future<void> putConfigurationRecorder({
required ConfigurationRecorder configurationRecorder,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StarlingDoveService.PutConfigurationRecorder'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConfigurationRecorder': configurationRecorder,
if (tags != null) 'Tags': tags,
},
);
}