associateEnvironmentOperationsRole method

Future<void> associateEnvironmentOperationsRole({
  1. required String environmentName,
  2. required String operationsRole,
})

Add or change the operations role used by an environment. After this call is made, Elastic Beanstalk uses the associated operations role for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.

May throw InsufficientPrivilegesException.

Parameter environmentName : The name of the environment to which to set the operations role.

Parameter operationsRole : The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role.

Implementation

Future<void> associateEnvironmentOperationsRole({
  required String environmentName,
  required String operationsRole,
}) async {
  ArgumentError.checkNotNull(environmentName, 'environmentName');
  _s.validateStringLength(
    'environmentName',
    environmentName,
    4,
    40,
    isRequired: true,
  );
  ArgumentError.checkNotNull(operationsRole, 'operationsRole');
  _s.validateStringLength(
    'operationsRole',
    operationsRole,
    1,
    256,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['EnvironmentName'] = environmentName;
  $request['OperationsRole'] = operationsRole;
  await _protocol.send(
    $request,
    action: 'AssociateEnvironmentOperationsRole',
    version: '2010-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['AssociateEnvironmentOperationsRoleMessage'],
    shapes: shapes,
  );
}