Container for the parameters to the ModifyVpcPeeringConnectionOptions operation. Modifies the VPC peering connection options on one side of a VPC peering connection. You can do the following:
  • Enable/disable communication over the peering connection between an EC2-Classic instance that's linked to your VPC (using ClassicLink) and instances in the peer VPC.

  • Enable/disable communication over the peering connection between instances in your VPC and an EC2-Classic instance that's linked to the peer VPC.

  • Enable/disable a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC.

If the peered VPCs are in different accounts, each owner must initiate a separate request to modify the peering connection options, depending on whether their VPC was the requester or accepter for the VPC peering connection. If the peered VPCs are in the same account, you can modify the requester and accepter options in the same request. To confirm which VPC is the accepter and requester for a VPC peering connection, use the DescribeVpcPeeringConnections command.

Наследование: AmazonEC2Request
Пример #1
0
        /// <summary>
        /// Initiates the asynchronous execution of the ModifyVpcPeeringConnectionOptions operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ModifyVpcPeeringConnectionOptions operation on AmazonEC2Client.</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 EndModifyVpcPeeringConnectionOptions
        ///         operation.</returns>
        public IAsyncResult BeginModifyVpcPeeringConnectionOptions(ModifyVpcPeeringConnectionOptionsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ModifyVpcPeeringConnectionOptionsRequestMarshaller();
            var unmarshaller = ModifyVpcPeeringConnectionOptionsResponseUnmarshaller.Instance;

            return BeginInvoke<ModifyVpcPeeringConnectionOptionsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Пример #2
0
        /// <summary>
        /// Modifies the VPC peering connection options on one side of a VPC peering connection.
        /// You can do the following:
        /// 
        ///  <ul> <li> 
        /// <para>
        /// Enable/disable communication over the peering connection between an EC2-Classic instance
        /// that's linked to your VPC (using ClassicLink) and instances in the peer VPC.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Enable/disable communication over the peering connection between instances in your
        /// VPC and an EC2-Classic instance that's linked to the peer VPC.
        /// </para>
        ///  </li> <li> 
        /// <para>
        /// Enable/disable a local VPC to resolve public DNS hostnames to private IP addresses
        /// when queried from instances in the peer VPC.
        /// </para>
        ///  </li> </ul> 
        /// <para>
        /// If the peered VPCs are in different accounts, each owner must initiate a separate
        /// request to modify the peering connection options, depending on whether their VPC was
        /// the requester or accepter for the VPC peering connection. If the peered VPCs are in
        /// the same account, you can modify the requester and accepter options in the same request.
        /// To confirm which VPC is the accepter and requester for a VPC peering connection, use
        /// the <a>DescribeVpcPeeringConnections</a> command.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ModifyVpcPeeringConnectionOptions service method.</param>
        /// 
        /// <returns>The response from the ModifyVpcPeeringConnectionOptions service method, as returned by EC2.</returns>
        public ModifyVpcPeeringConnectionOptionsResponse ModifyVpcPeeringConnectionOptions(ModifyVpcPeeringConnectionOptionsRequest request)
        {
            var marshaller = new ModifyVpcPeeringConnectionOptionsRequestMarshaller();
            var unmarshaller = ModifyVpcPeeringConnectionOptionsResponseUnmarshaller.Instance;

            return Invoke<ModifyVpcPeeringConnectionOptionsRequest,ModifyVpcPeeringConnectionOptionsResponse>(request, marshaller, unmarshaller);
        }
Пример #3
0
 private Amazon.EC2.Model.ModifyVpcPeeringConnectionOptionsResponse CallAWSServiceOperation(IAmazonEC2 client, Amazon.EC2.Model.ModifyVpcPeeringConnectionOptionsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Compute Cloud (EC2)", "ModifyVpcPeeringConnectionOptions");
     try
     {
         #if DESKTOP
         return(client.ModifyVpcPeeringConnectionOptions(request));
         #elif CORECLR
         return(client.ModifyVpcPeeringConnectionOptionsAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Пример #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ModifyVpcPeeringConnectionOptions operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ModifyVpcPeeringConnectionOptions 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<ModifyVpcPeeringConnectionOptionsResponse> ModifyVpcPeeringConnectionOptionsAsync(ModifyVpcPeeringConnectionOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ModifyVpcPeeringConnectionOptionsRequestMarshaller();
            var unmarshaller = ModifyVpcPeeringConnectionOptionsResponseUnmarshaller.Instance;

            return InvokeAsync<ModifyVpcPeeringConnectionOptionsRequest,ModifyVpcPeeringConnectionOptionsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Пример #5
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.EC2.Model.ModifyVpcPeeringConnectionOptionsRequest();


            // populate AccepterPeeringConnectionOptions
            var requestAccepterPeeringConnectionOptionsIsNull = true;

            request.AccepterPeeringConnectionOptions = new Amazon.EC2.Model.PeeringConnectionOptionsRequest();
            System.Boolean?requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc = null;
            if (cmdletContext.AccepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc != null)
            {
                requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc = cmdletContext.AccepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc.Value;
            }
            if (requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc != null)
            {
                request.AccepterPeeringConnectionOptions.AllowDnsResolutionFromRemoteVpc = requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc.Value;
                requestAccepterPeeringConnectionOptionsIsNull = false;
            }
            System.Boolean?requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc = null;
            if (cmdletContext.AccepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc != null)
            {
                requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc = cmdletContext.AccepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc.Value;
            }
            if (requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc != null)
            {
                request.AccepterPeeringConnectionOptions.AllowEgressFromLocalClassicLinkToRemoteVpc = requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc.Value;
                requestAccepterPeeringConnectionOptionsIsNull = false;
            }
            System.Boolean?requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink = null;
            if (cmdletContext.AccepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink != null)
            {
                requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink = cmdletContext.AccepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink.Value;
            }
            if (requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink != null)
            {
                request.AccepterPeeringConnectionOptions.AllowEgressFromLocalVpcToRemoteClassicLink = requestAccepterPeeringConnectionOptions_accepterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink.Value;
                requestAccepterPeeringConnectionOptionsIsNull = false;
            }
            // determine if request.AccepterPeeringConnectionOptions should be set to null
            if (requestAccepterPeeringConnectionOptionsIsNull)
            {
                request.AccepterPeeringConnectionOptions = null;
            }

            // populate RequesterPeeringConnectionOptions
            var requestRequesterPeeringConnectionOptionsIsNull = true;

            request.RequesterPeeringConnectionOptions = new Amazon.EC2.Model.PeeringConnectionOptionsRequest();
            System.Boolean?requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc = null;
            if (cmdletContext.RequesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc != null)
            {
                requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc = cmdletContext.RequesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc.Value;
            }
            if (requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc != null)
            {
                request.RequesterPeeringConnectionOptions.AllowDnsResolutionFromRemoteVpc = requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowDnsResolutionFromRemoteVpc.Value;
                requestRequesterPeeringConnectionOptionsIsNull = false;
            }
            System.Boolean?requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc = null;
            if (cmdletContext.RequesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc != null)
            {
                requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc = cmdletContext.RequesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc.Value;
            }
            if (requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc != null)
            {
                request.RequesterPeeringConnectionOptions.AllowEgressFromLocalClassicLinkToRemoteVpc = requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalClassicLinkToRemoteVpc.Value;
                requestRequesterPeeringConnectionOptionsIsNull = false;
            }
            System.Boolean?requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink = null;
            if (cmdletContext.RequesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink != null)
            {
                requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink = cmdletContext.RequesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink.Value;
            }
            if (requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink != null)
            {
                request.RequesterPeeringConnectionOptions.AllowEgressFromLocalVpcToRemoteClassicLink = requestRequesterPeeringConnectionOptions_requesterPeeringConnectionOptions_AllowEgressFromLocalVpcToRemoteClassicLink.Value;
                requestRequesterPeeringConnectionOptionsIsNull = false;
            }
            // determine if request.RequesterPeeringConnectionOptions should be set to null
            if (requestRequesterPeeringConnectionOptionsIsNull)
            {
                request.RequesterPeeringConnectionOptions = null;
            }
            if (cmdletContext.VpcPeeringConnectionId != null)
            {
                request.VpcPeeringConnectionId = cmdletContext.VpcPeeringConnectionId;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }