CDK declaration for free tier RDS instance

0

Hi guys,

I'm trying to reproduce through CDK a 'free tier' RDS configuration, the same than i successfully did via the console and by selecting the 'free tier configuration'.

However, i can't understand why the following code does not create a 'free tier' ressource:

    const rdsInstance = new rds.DatabaseInstance(this, 'PostGis', {
        engine: rds.DatabaseInstanceEngine.postgres({
            version: rds.PostgresEngineVersion.VER_16_1
        }),
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
        vpc,
        vpcSubnets: {
            subnetType: ec2.SubnetType.PUBLIC
        },
        securityGroups: [securityGroup],
        multiAz: false,
        allocatedStorage: 20,
        maxAllocatedStorage: 20,
        backupRetention: cdk.Duration.days(7),
        deletionProtection: false,
        databaseName: dataBaseName,
        credentials: rds.Credentials.fromUsername('pgadmin', {
        password : cdk.SecretValue.unsafePlainText('####') 
        }) 
    });

i've been comparing in console the configuration between the 'free tier' console created, and the CDK created, without being able to point out any difference. Still, i can see in billing i'm been charged for a regular t3.micro for the CDK created one.

Any idea will be appreciated,

Thanks !

Nico

1개 답변
1
수락된 답변

The charge may come from the backup storage or the storageType may be gp2 explicitly.

the backup can be disabled with backupRetention: Duration.days(0) if it's the case.

c3qo
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • Thanks, looks like it indeed the job !

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠