0

First : I want to create access for my ALB to store logs in my s3 bucket,

AccessLoggingPolicy=elb.AccessLoggingPolicy(
                 EmitInterval=5,
                 Enabled=True,
                 S3BucketName="logging",
                 S3BucketPrefix="APPALB",
             ),

Here i defined but this code is for ELBv1 but i am using ELBv2 how can i define it.

Second : Another one i want to create Deletion protection for my elb, I searched alot but i didn't find any where how to do it using Troposphare cloud formation.

        LoadBalancerAttributes=elb.LoadBalancerAttributes(
            DeletionProtection='True',
        )
    ))

Help me Fix this.

Rajat jain
  • 1,715
  • 3
  • 12
  • 21

1 Answers1

1

Finally i got the answers. Here you can take References.

LoadBalancerAttributes=[
            elb.LoadBalancerAttributes(
                Key='deletion_protection.enabled', Value='true',
            ),
            elb.LoadBalancerAttributes(
                Key='access_logs.s3.enabled', Value='true',
            ),
            elb.LoadBalancerAttributes(
                Key='access_logs.s3.bucket', Value=Ref(Bucket),
            ),
            elb.LoadBalancerAttributes(
                Key='access_logs.s3.prefix', Value='Logs',
            ),
        ]
Rajat jain
  • 1,715
  • 3
  • 12
  • 21