0

I would like to create ClientVPNEndPoint by using Powershell module AWSPowerShell.NetCore version 4.1.385 on Windows 10 Pro.

When I run this :

    $serverCertificat = Get-ACMCertificateList | where-object { $_.DomainName -eq "server" } 
    $clientCertificat = Get-ACMCertificateList | where-object { $_.DomainName -eq "client1.domain.tld" } 

    $Authentication = new-object Amazon.EC2.Model.ClientVpnAuthenticationRequest
    $Authentication.Type = Amazon.EC2.ClientVpnAuthenticationType.CertificateAuthentication
    $Authentication.MutualAuthentication = new-object Amazon.EC2.Model.CertificateAuthenticationRequest
    $Authentication.MutualAuthentication.ClientRootCertificateChainArn = $clientCertificat.CertificateArn
    
    New-EC2ClientVpnEndpoint -ClientCidrBlock "10.0.0.0/22" `
                            -ServerCertificateArn $serverCertificat.CertificateArn `
                            -AuthenticationOption @($Authentication) `
                            -DnsServer @("172.31.43.131","172.31.30.194") `
                            -vpcid (Get-EC2VPC).VpcId `
                            -ConnectionLogOptions_Enabled $false

... I got following error

Amazon.EC2.ClientVpnAuthenticationType.CertificateAuthentication: 
Line |
   8 |  … tion.Type = Amazon.EC2.ClientVpnAuthenticationType.CertificateAuthent …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The term 'Amazon.EC2.ClientVpnAuthenticationType.CertificateAuthentication' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
New-EC2ClientVpnEndpoint: 
Line |
  12 |  New-EC2ClientVpnEndpoint -ClientCidrBlock "10.0.0.0/22" `
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Authentication type is required but is missing in the request

Note 1 : Link to PS function documentation : https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2ClientVpnEndpoint.html

Note 2 : I have checked PS Module dll and more specifically the Amazon.EC2.ClientVpnAuthenticationType without any help

using System;
using Amazon.Runtime;

namespace Amazon.EC2
{
    // Token: 0x02000032 RID: 50
    public class ClientVpnAuthenticationType : ConstantClass
    {
        // Token: 0x060005C6 RID: 1478 RVA: 0x00012B61 File Offset: 0x00010D61
        public ClientVpnAuthenticationType(string value) : base(value)
        {
        }

        // Token: 0x060005C7 RID: 1479 RVA: 0x00012B6A File Offset: 0x00010D6A
        public static ClientVpnAuthenticationType FindValue(string value)
        {
            return ConstantClass.FindValue<ClientVpnAuthenticationType>(value);
        }

        // Token: 0x060005C8 RID: 1480 RVA: 0x00012B72 File Offset: 0x00010D72
        public static implicit operator ClientVpnAuthenticationType(string value)
        {
            return ClientVpnAuthenticationType.FindValue(value);
        }

        // Token: 0x040000B5 RID: 181
        public static readonly ClientVpnAuthenticationType CertificateAuthentication = new ClientVpnAuthenticationType("certificate-authentication");

        // Token: 0x040000B6 RID: 182
        public static readonly ClientVpnAuthenticationType DirectoryServiceAuthentication = new ClientVpnAuthenticationType("directory-service-authentication");

        // Token: 0x040000B7 RID: 183
        public static readonly ClientVpnAuthenticationType FederatedAuthentication = new ClientVpnAuthenticationType("federated-authentication");
    }
}
3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.