CloudFormation detect drift for IAM:Role does not detect manual change

0

I've created blank IAM:Role to check if drift detection works:

Resources:
  BlankRole:
    Type: AWS::IAM::Role
    Properties:
        RoleName: !Sub '${EnvType}-dp-blank-role'
        Description: "Blank role to check if drift would be detected"
        MaxSessionDuration: 3600
        Path: "/"
        AssumeRolePolicyDocument:
          Version: '2012-10-17'               
          Statement:
            - Effect: Allow
              Principal: {'Service': ['glue.amazonaws.com']}
              Action: ['sts:AssumeRole']

After stack was created I've made two manual changes adding in Permissions two policies: AWS managed - AWSGlueServiceRole Customer managed created automatically with one of the services

After that I've waited a minute and I've triggered drift detection. I was doing in for Resource detection, Stact detection (both in Console) and I tried this as well through CLI. Nothing works and CloudFormation does not see differences.

Meras
posta 8 mesi fa237 visualizzazioni
1 Risposta
0
Risposta accettata

Hello.

The following document shows that "AWS::IAM::Role" does not support drift detection.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html

profile picture
ESPERTO
con risposta 8 mesi fa
profile pictureAWS
ESPERTO
verificato 8 mesi fa
  • If I will make change in component which exists in original Role template (i.e. ManagedPolicies - add new one) then some times Drift is shown. This fools me that it's actually works.

    I don't see why CloudFormation is considered as good tool If I cannot control consistency between planned resources and current resources.

  • Agreed with Riku: not all features in all services support drift detection by CFN. You have to check the list that he points to to define which ones in your config are supported.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande