Exemplo n.º 1
0
        public void PutConfigRuleMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <PutConfigRuleRequest>();
            var marshaller = new PutConfigRuleRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <PutConfigRuleRequest>(request, jsonRequest);
        }
        public void PutConfigRuleMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<PutConfigRuleRequest>();
            var marshaller = new PutConfigRuleRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<PutConfigRuleRequest>(request,jsonRequest);

        }
        /// <summary>
        /// Adds or updates an AWS Config rule for evaluating whether your AWS resources comply
        /// with your desired configurations. 
        /// 
        ///  
        /// <para>
        /// You can use this action for customer managed Config rules and AWS managed Config rules.
        /// A customer managed Config rule is a custom rule that you develop and maintain. An
        /// AWS managed Config rule is a customizable, predefined rule that is provided by AWS
        /// Config.
        /// </para>
        ///  
        /// <para>
        /// If you are adding a new customer managed Config rule, you must first create the AWS
        /// Lambda function that the rule invokes to evaluate your resources. When you use the
        /// <code>PutConfigRule</code> action to add the rule to AWS Config, you must specify
        /// the Amazon Resource Name (ARN) that AWS Lambda assigns to the function. Specify the
        /// ARN for the <code>SourceIdentifier</code> key. This key is part of the <code>Source</code>
        /// object, which is part of the <code>ConfigRule</code> object. 
        /// </para>
        ///  
        /// <para>
        /// If you are adding a new AWS managed Config rule, specify the rule's identifier for
        /// the <code>SourceIdentifier</code> key. To reference AWS managed Config rule identifiers,
        /// see <a href="http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html">Using
        /// AWS Managed Config Rules</a>.
        /// </para>
        ///  
        /// <para>
        /// For any new rule that you add, specify the <code>ConfigRuleName</code> in the <code>ConfigRule</code>
        /// object. Do not specify the <code>ConfigRuleArn</code> or the <code>ConfigRuleId</code>.
        /// These values are generated by AWS Config for new rules.
        /// </para>
        ///  
        /// <para>
        /// If you are updating a rule that you have added previously, specify the rule's <code>ConfigRuleName</code>,
        /// <code>ConfigRuleId</code>, or <code>ConfigRuleArn</code> in the <code>ConfigRule</code>
        /// data type that you use in this request.
        /// </para>
        ///  
        /// <para>
        /// The maximum number of rules that AWS Config supports is 25.
        /// </para>
        ///  
        /// <para>
        /// For more information about developing and using AWS Config rules, see <a href="http://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html">Evaluating
        /// AWS Resource Configurations with AWS Config</a> in the <i>AWS Config Developer Guide</i>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the PutConfigRule service method.</param>
        /// 
        /// <returns>The response from the PutConfigRule service method, as returned by ConfigService.</returns>
        /// <exception cref="Amazon.ConfigService.Model.InsufficientPermissionsException">
        /// Indicates one of the following errors:
        /// 
        ///  <ul> <li>The rule cannot be created because the IAM role assigned to AWS Config lacks
        /// permissions to perform the config:Put* action.</li> <li>The AWS Lambda function cannot
        /// be invoked. Check the function ARN, and check the function's permissions.</li> </ul>
        /// </exception>
        /// <exception cref="Amazon.ConfigService.Model.InvalidParameterValueException">
        /// One or more of the specified parameters are invalid. Verify that your parameters are
        /// valid and try again.
        /// </exception>
        /// <exception cref="Amazon.ConfigService.Model.MaxNumberOfConfigRulesExceededException">
        /// Failed to add the AWS Config rule because the account already contains the maximum
        /// number of 25 rules. Consider deleting any deactivated rules before adding new rules.
        /// </exception>
        /// <exception cref="Amazon.ConfigService.Model.ResourceInUseException">
        /// The rule is currently being deleted. Wait for a while and try again.
        /// </exception>
        public PutConfigRuleResponse PutConfigRule(PutConfigRuleRequest request)
        {
            var marshaller = new PutConfigRuleRequestMarshaller();
            var unmarshaller = PutConfigRuleResponseUnmarshaller.Instance;

            return Invoke<PutConfigRuleRequest,PutConfigRuleResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the PutConfigRule operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the PutConfigRule operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<PutConfigRuleResponse> PutConfigRuleAsync(PutConfigRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new PutConfigRuleRequestMarshaller();
            var unmarshaller = PutConfigRuleResponseUnmarshaller.Instance;

            return InvokeAsync<PutConfigRuleRequest,PutConfigRuleResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the PutConfigRule operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the PutConfigRule operation on AmazonConfigServiceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutConfigRule
        ///         operation.</returns>
        public IAsyncResult BeginPutConfigRule(PutConfigRuleRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new PutConfigRuleRequestMarshaller();
            var unmarshaller = PutConfigRuleResponseUnmarshaller.Instance;

            return BeginInvoke<PutConfigRuleRequest>(request, marshaller, unmarshaller,
                callback, state);
        }