Chilkat Online Tools

ReplicateSecretToRegions unicodeC Example

AWS Secrets Manager

void ChilkatSample(void)
    {

    CkAuthAwsW_putAccessKey(authAws,L"AWS_ACCESS_KEY");    CkAuthAwsW_putSecretKey(authAws,L"AWS_SECRET_KEY");    CkAuthAwsW_putRegion(authAws,L"us-west-2");    CkAuthAwsW_putServiceName(authAws,L"secretsmanager");    CkRestW_SetAuthAws(rest,authAws);    success = CkRestW_Connect(rest,L"secretsmanager.us-west-2.amazonaws.com",443,TRUE,TRUE);    CkJsonObjectW_UpdateString(json,L"AddReplicaRegions[0].KmsKeyId",L"string");    CkJsonObjectW_UpdateString(json,L"AddReplicaRegions[0].Region",L"string");    CkJsonObjectW_UpdateInt(json,L"ForceOverwriteReplicaSecret",123);    CkJsonObjectW_UpdateString(json,L"SecretId",L"string");    CkRestW_AddHeader(rest,L"Content-Type",L"application/x-amz-json-1.1");    CkRestW_AddHeader(rest,L"X-Amz-Target",L"secretsmanager.ReplicateSecretToRegions");    CkJsonObjectW_EmitSb(json,sbRequestBody);    success = CkRestW_FullRequestSb(rest,L"POST",L"/",sbRequestBody,sbResponseBody);    CkJsonObjectW_LoadSb(jResp,sbResponseBody);    CkJsonObjectW_putI(jResp,i);    KmsKeyId = CkJsonObjectW_stringOf(jResp,L"ReplicationStatus[i].KmsKeyId");    LastAccessedDate = CkJsonObjectW_IntOf(jResp,L"ReplicationStatus[i].LastAccessedDate");    Region = CkJsonObjectW_stringOf(jResp,L"ReplicationStatus[i].Region");    Status = CkJsonObjectW_stringOf(jResp,L"ReplicationStatus[i].Status");    StatusMessage = CkJsonObjectW_stringOf(jResp,L"ReplicationStatus[i].StatusMessage");    i = i + 1;


    }