Skip to content

Accelerator: FromAcceleratorAttributes method gives CS0426 error #28076

Open
@werebear73-tritelph

Description

@werebear73-tritelph

Describe the bug

When I try to use the FromAcceleratorAttributes method to get an existing Global Accelerator I get a CS0426 error.

Accelerator globalAccelerator = new Accelerator.FromAcceleratorAttributes(this, $"TestGlobalAccelerator", new AcceleratorAttributes()
        {
            AcceleratorArn = System.Environment.GetEnvironmentVariable("AcceleratorArn"),
            DnsName = System.Environment.GetEnvironmentVariable("DnsName"),
        });

Severity Code Description
Error CS0426 The type name 'FromAcceleratorAttributes' does not exist in the type 'Accelerator'

Expected Behavior

That I can reference an existing Global Accelerator in my stack.

Current Behavior

Error Message in VS2022

Reproduction Steps

Use this code

Accelerator globalAccelerator = new Accelerator.FromAcceleratorAttributes(this, $"TestGlobalAccelerator", new AcceleratorAttributes()
        {
            AcceleratorArn = System.Environment.GetEnvironmentVariable("AcceleratorArn"),
            DnsName = System.Environment.GetEnvironmentVariable("DnsName"),
        });

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.106.0

Framework Version

No response

Node.js Version

v18.16.0

OS

Windows 11

Language

.NET

Language Version

6.0

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions