@SdkInternalApi
    final ReplaceIamInstanceProfileAssociationResult executeReplaceIamInstanceProfileAssociation(
            ReplaceIamInstanceProfileAssociationRequest replaceIamInstanceProfileAssociationRequest) {

        ExecutionContext executionContext = createExecutionContext(replaceIamInstanceProfileAssociationRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<ReplaceIamInstanceProfileAssociationRequest> request = null;
        Response<ReplaceIamInstanceProfileAssociationResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new ReplaceIamInstanceProfileAssociationRequestMarshaller().marshall(super
                        .beforeMarshalling(replaceIamInstanceProfileAssociationRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ReplaceIamInstanceProfileAssociation");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            StaxResponseHandler<ReplaceIamInstanceProfileAssociationResult> responseHandler = new StaxResponseHandler<ReplaceIamInstanceProfileAssociationResult>(
                    new ReplaceIamInstanceProfileAssociationResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Replaces an IAM instance profile for the specified running instance. You can use this action to change the IAM
instance profile that's associated with an instance without having to disassociate the existing IAM instance
profile first.
</p>
<p>
Use <a>DescribeIamInstanceProfileAssociations</a> to get the association ID.
</p>

@param replaceIamInstanceProfileAssociationRequest
@return Result of the ReplaceIamInstanceProfileAssociation operation returned by the service.
@sample AmazonEC2.ReplaceIamInstanceProfileAssociation
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation"
     target="_top">AWS API Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java