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
gefragt vor 8 Monaten239 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 8 Monaten
profile pictureAWS
EXPERTE
überprüft vor 8 Monaten
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen